Search Postgresql Archives

FK index q'n

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

 



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 WHERE bar_id IS NULL;

Table foo will contain a static number of rows (from 2,000 to 10,000 -- yet undecided) only doing SELECT & UPDATE.

Thanks.

---------------------------(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