Re: join on three tables is slow - Mailing list pgsql-sql

From Pavel Stehule
Subject Re: join on three tables is slow
Date
Msg-id 162867790712111146x35f547c0pc01fcf1aa167e0e5@mail.gmail.com
Whole thread Raw
In response to Re: join on three tables is slow  (Gerry Reno <greno@verizon.net>)
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Foreign Key for multi PK or design question
Next
From: "A. Kretschmer"
Date:
Subject: Re: Foreign Key for multi PK or design question