session_dogs table
The session_dogs table in the Cord Powell Hot Dog Tracker schema has 9 columns, keyed by id, with 2 foreign keys to sessions and hot_dog_styles. 1 column in session_dog_condiments references it.
THE CORE TABLE -- one row per hot dog. This grain is the whole point of the schema. sequence_no + seconds_from_start give the pace curve and locate "the wall" (the dog number where the gap between consecutive dogs blows up), which is the real physical limiter. fraction_eaten keeps the final partial dog honest. Expect this table to dominate row count. That is fine and intended: a 70-dog contest is 70 rows.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| session_id | uuid | not null, references sessions.id | ON DELETE CASCADE with the session. |
| sequence_no | integer | not null | Dog number within the session, 1-based. |
| style_id | uuid | references hot_dog_styles.id | Usually constant within a session, but not required to be. |
| consumed_at | timestamptz | not null | Wall clock, for correlating with anything external. |
| seconds_from_start | integer | not null | Offset from sessions.started_at. Denormalized on purpose: every pace and wall query sorts and windows on this, and deriving it per query makes the interesting analytics awkward and slow. |
| fraction_eaten | numeric(3,2) | not null | Handles the half dog in hand at the buzzer. Sum this, do not COUNT(*), for an exact total. |
| bun_condition | bun_condition | not null | |
| notes | text |
Indexes (3)
(session_id, sequence_no)unique(session_id, seconds_from_start)(style_id)
Relationships
session_dogs.session_idreferencessessions.idsession_dogs.style_idreferenceshot_dog_styles.idsession_dog_condiments.session_dog_idreferencessession_dogs