From: Gerry Reno <greno@verizon.net>
To: pgsql-sql@postgresql.org
Subject: Re: join on three tables is slow
Date: Wed, 12 Dec 2007 09:29:49 -0500
Message-ID: <475FF05D.9040009@verizon.net> (raw)
In-Reply-To: <11806.1197434157@sss.pgh.pa.us>
References: <475C96EA.6090002@verizon.net>
<475CC478.7010102@Sheeky.Biz>
<475E111B.6060203@verizon.net>
<162867790712102200m2144573bw7447e0eff6720d55@mail.gmail.com>
<475E8F6A.4030004@verizon.net>
<162867790712110655o2cf99bf1n9acf6b440d726440@mail.gmail.com>
<475ED469.5080906@verizon.net>
<11806.1197434157@sss.pgh.pa.us>
Tom Lane wrote:
> Gerry Reno <greno@verizon.net> writes:
>
>> Pavel Stehule wrote:
>>
>>> there is diference in agg position. Send, please, query and explain
>>> analyze output.
>>>
>
> [ explain analyze output ]
>
> The rowcount estimates seem pretty far off, even for simple cases that
> I'd expect it to get right, eg
>
>
>> -> Seq Scan on res_partner_address a (cost=0.00..88.40
>> rows=16 width=552) (actual time=0.851..16.131 rows=559 loops=1)
>> Filter: ((("type")::text = 'default'::text) OR ("type" IS
>> NULL))
>>
>
> Are the ANALYZE stats up to date for these tables?
>
> What PG version is this, anyway?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
-bash-3.2$ yum list postgresql
Loading "installonlyn" plugin
Installed Packages
postgresql.i386 8.2.4-1.fc7
installed
You were right on the money Tom. I vacuumed the database and now the
query with the boolean executes in only 50% more time than without.
About 15 secs instead of 10 secs. Big improvement. I hadn't seen a
vacuum produce this much of an improvement in performance before.
Thanks,
Gerry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: greno@verizon.net
Subject: Re: join on three tables is slow
In-Reply-To: <475FF05D.9040009@verizon.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox