[GENERAL] Will PG use composite index to enforce foreign keys?

2007-11-29 Thread John Burger
Hi - I know that the foreign key machinery will use an index on the referring column if one exists. My question is whether it will use a composite index? For instance: create table allLemmaSenseMap ( wordID integer references allLemmas, senseIDinteger references allSenses, p

Re: [GENERAL] Will PG use composite index to enforce foreign keys?

2007-11-30 Thread Scott Marlowe
On Nov 29, 2007 10:51 AM, John Burger <[EMAIL PROTECTED]> wrote: > Hi - > > I know that the foreign key machinery will use an index on the > referring column if one exists. My question is whether it will use a > composite index? For instance: > > create table allLemmaSenseMap ( >wordID in

Re: [GENERAL] Will PG use composite index to enforce foreign keys?

2007-12-03 Thread John Burger
Scott Marlowe wrote: As a secondary question, is there any way I could have answered this myself, using analyze, the system catalogs, etc? ANALYZE DELETE doesn't seem to show the FK checking that must go on behind the scenes. You could have coded up an example to see if it worked I guess. H

Re: [GENERAL] Will PG use composite index to enforce foreign keys?

2007-12-03 Thread Gregory Stark
"John Burger" <[EMAIL PROTECTED]> writes: > Scott Marlowe wrote: > >>> As a secondary question, is there any way I could have answered this >>> myself, using analyze, the system catalogs, etc? ANALYZE DELETE >>> doesn't seem to show the FK checking that must go on behind the scenes. >> >> You co

Re: [GENERAL] Will PG use composite index to enforce foreign keys?

2007-12-03 Thread John Burger
Gregory Stark wrote: I guess a generalization of my question is whether the FK- checking machinery simply does a SELECT against the referencing column. It does Actually the query is (effectively, assuming your equality operators are named "=" and the columns match in type) SELECT 1 F