Re: [SQL] design question: status table+log table, indexes, triggers

2003-02-05 Thread Tom Lane
george young <[EMAIL PROTECTED]> writes: > This schema seemed logical at the outset, but the most common query is: > select m.machine_name, m.text, ml.status, ml.date >from machine m, machine_log ml >where m.machine_name=ml.machine_name and ml.date=(select max(date)from > machine_log whe

[SQL] design question: status table+log table, indexes, triggers

2003-02-05 Thread george young
[postgresql-7.2, pgsql, linux] Here's a schema-design problem I've hit a few times -- it seems like there should be a better way: I have a machine table (140 rows), currently very static: machine(machine_name text NOT NULL, machine_id smallint NOT NULL, area text NOT NULL, text text NO