Re: SELECT INTO large FKyed table is slow

Поиск
Список
Период
Сортировка
От Mark Kirkwood
Тема Re: SELECT INTO large FKyed table is slow
Дата
Msg-id 4CF58DC5.5040101@catalyst.net.nz
обсуждение исходный текст
Ответ на Re: SELECT INTO large FKyed table is slow  ("Pierre C" <lists@peufeu.com>)
Список pgsql-performance
On 30/11/10 05:53, Pierre C wrote:
>
>> Yes, since (sample_id, drone_id) is primary key, postgres created
>> composite index on those columns. Are you suggesting I add two more
>> indexes, one for drone_id and one for sample_id?
>
> (sample_id,drone_id) covers sample_id but if you make searches on
> drone_id alone it is likely to be very slow since you got a large
> number of sample_ids. Postgres can use any column of a multicolumn
> index but it is only interesting performance-wise if the cardinality
> of the first (ignored) columns is low. If you often make searches on
> drone_id, create an index. But this isn't what is slowing your foreign
> key checks.

Exactly, sorry - I was having a brain fade moment about which way your
foreign key checks were going when I suggested adding those indexes... :-(

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

Предыдущее
От: "T.H."
Дата:
Сообщение: Re: Question about subselect/IN performance
Следующее
От: Mario Splivalo
Дата:
Сообщение: Re: SELECT INTO large FKyed table is slow