Organizing SQL tables and named queries efficiently

Event logs are the poster child for “tall” tables. So, option 1, unquestionably.

For efficiency, I would use a numeric foreign key for machine, where a separate, relatively static table of machines has that as a primary key. I would also omit duration, as it is easily generated from lead(t_stamp) over (partition by machine order by t_stamp).

3 Likes