Search Postgresql Archives

Will PG use composite index to enforce foreign keys?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
  senseID    integer references allSenses,
  primary key (wordID, senseID)
);

If I delete something from allLemmas, will the FK check use the PK index above? (I know I should at least have an index on senseID as well, because of the other foreign key.)

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.

Thanks.

- John D. Burger
  MITRE



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux