Re: join on three tables is slow

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: join on three tables is slow
Дата
Msg-id 162867790712111146x35f547c0pc01fcf1aa167e0e5@mail.gmail.com
обсуждение исходный текст
Ответ на Re: join on three tables is slow  (Gerry Reno <greno@verizon.net>)
Список pgsql-sql
Hello

1) increase statistics on res_partner_address.type (about 100)

alter table ...ALTER [ COLUMN ] column SET STATISTICS integer

do analyze, and look again on plans. There are difference
     ->  Seq Scan on res_partner_address a  (cost=0.00..88.40
rows=16 width=552) (actual time=0.106..3.521 rows=559 loops=510)             Filter: ((("type")::text =
'default'::text)OR ("type" IS
 
NULL))

2) I thing so index on res_partner.addr can help or use better column
for identification (varchar isn't best) and partial index

rep_partner_address.type is 'default' or resp_partner_address.type is null.

Regards
Pavel Stehule


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Foreign Key for multi PK or design question
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Foreign Key for multi PK or design question