Re: [GENERAL] FK index q'n

2007-11-30 Thread Alvaro Herrera
Tom Lane wrote: > rihad <[EMAIL PROTECTED]> writes: > > Given this table: > > CREATE TABLE foo ( > > id integer primary key, > > bar_id integer references bar (id) > > ); > > and provided that bar.id is itself a PK, do I still need to create an > > index on bar_id if often doing queries

Re: [GENERAL] FK index q'n

2007-11-30 Thread Tom Lane
rihad <[EMAIL PROTECTED]> writes: > Given this table: > CREATE TABLE foo ( > id integer primary key, > bar_id integer references bar (id) > ); > and provided that bar.id is itself a PK, do I still need to create an > index on bar_id if often doing queries like: > SELECT MIN(id) FROM foo