Re: make a unique index for foreign keys?

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: make a unique index for foreign keys?
Дата
Msg-id GNELIHDDFBOCMGBFGEFOCEMBCCAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: make a unique index for foreign keys?  ("Beth Gatewood" <beth@vizxlabs.com>)
Список pgsql-sql
> Chris/ Josh-
>
> OK-response to Chris below.  Synopsis here....simply by creating a foreign
> key will not create an index.  On large tables I SHOULD put a non-unique
> index on the foreign key (right?)

For large tables, I guess you may as well.  You can be more scientific about
it if you you unhash this in your postgresql.conf:

stats_command_string = true
stats_row_level = true
stats_block_level = true

Then you can just use the pg_stat views to see how many sequential scans are
being run over your tables and how expensive they are, etc.

Chris



В списке pgsql-sql по дате отправления:

Предыдущее
От: "joo"
Дата:
Сообщение: Re: join question - requesting for a simple C program where it can INSERT data into database as reference
Следующее
От: Tom Lane
Дата:
Сообщение: Re: simple recursive function in plpgsql fails