Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COI feel this solution is actually worse than the others because 1) two `UPDATE`s instead of one are required to change the active record, 2) an extra index is required (with the performance hit that involves), 3) the same datum is stored more than once, 4) not only are `NULL`s allowed, they're *required*, and 5) the information is stored in the wrong place (the active record is an attribute of it's owner, not the record itself). In addition, both of the suggestions I made are declarative as well.
      singulars
    2. COHuh?!?! The mthods that you describe require extra updates. This requires none. The data is NOT stored more than once. The index maintenance is almost always completely negligible and is certainly less than maintaining extra tables to track "active" rows. It does not require any NULLs at all. Both of your solutions require extra tables. I think you've thoroughly misunderstood something here.
      singulars
    3. CONot at all. In my solution, there is **no** `IsActive` field to `UPDATE`. The *only* `UPDATE` required is to one record in either in the `systems` table of the `system_active_groups` table, depending on the method chosen (in one of the two solutions, it would be an INSERT OR UPDATE). If you maintain the `IsActive` field, you need to `UPDATE` two records. The data *is* stored more than once, because inactive status is held both in the record that's inactive and a second time in the record that is active. You're right that you could use 0 instead of `NULL` for the second storage, however.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload