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)

Columns of the session_dogs table
ColumnTypeConstraintsDescription
iduuidprimary key
session_iduuidnot null, references sessions.idON DELETE CASCADE with the session.
sequence_nointegernot nullDog number within the session, 1-based.
style_iduuidreferences hot_dog_styles.idUsually constant within a session, but not required to be.
consumed_attimestamptznot nullWall clock, for correlating with anything external.
seconds_from_startintegernot nullOffset 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_eatennumeric(3,2)not nullHandles the half dog in hand at the buzzer. Sum this, do not COUNT(*), for an exact total.
bun_conditionbun_conditionnot null
notestext

Indexes (3)

  • (session_id, sequence_no) unique
  • (session_id, seconds_from_start)
  • (style_id)

Relationships