From: Benjamin Arai <benjamin@araisoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Shoaib Mir <shoaibmir@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: [GENERAL] OUTER JOIN IS SLOW
Date: Sat, 23 Dec 2006 18:32:59 -0800
Message-ID: <458DE6DB.2060609@araisoft.com> (raw)
In-Reply-To: <23901.1166925355@sss.pgh.pa.us>
References: <458D8D56.6020506@araisoft.com>
<bf54be870612231217j67759788pbfc3f84ffd705fd2@mail.gmail.com>
<bf54be870612231221l515f33b5k39c455476de0db7c@mail.gmail.com>
<458D9437.1000609@araisoft.com>
<23901.1166925355@sss.pgh.pa.us>
Hi,
I did a vacuum with -z and it fixed the issue. I was not aware that
vacuumdb didn't ANALYZE by default. Thanks everybody for all of the help!
Benjamin
Tom Lane wrote:
> Benjamin Arai <benjamin@araisoft.com> writes:
>
>> -> Index Scan using mutualfd_weekday_qbid_pkey_idx on
>> mutualfd_weekday_qbid (cost=0.00..6.01 rows=1 width=19) (actual
>> time=34.579..8510.801 rows=253 loops=1)
>> Index Cond: ((pkey >= '2005-12-15'::date) AND (pkey <=
>> '2006-12-15'::date))
>> Filter: (cusip = '92193920'::text)
>>
>
> Hm, so how many rows in mutualfd_weekday_qbid for that date?
> And how many satisfy the cusip condition? (I suppose 253,
> but it looks like that must be a very small fraction of all
> the rows for that date.)
>
> The selectivity estimators are not great about dealing with
> zero-width intervals like this one (in fact, if you look at the
> code you'll find it doesn't even bother to distinguish '>' from '>='
> ... something we should probably try to improve sometime).
>
> You'd probably have better luck if you could fold the WHERE condition
> down to "pkey = '2005-12-15'". Dunno how feasible that is for your
> application.
>
> regards, tom lane
>
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: benjamin@araisoft.com, tgl@sss.pgh.pa.us, shoaibmir@gmail.com, pgsql-general@postgresql.org
Subject: Re: [GENERAL] OUTER JOIN IS SLOW
In-Reply-To: <458DE6DB.2060609@araisoft.com>
References: <458D8D56.6020506@araisoft.com> <bf54be870612231217j67759788pbfc3f84ffd705fd2@mail.gmail.com> <bf54be870612231221l515f33b5k39c455476de0db7c@mail.gmail.com> <458D9437.1000609@araisoft.com> <23901.1166925355@sss.pgh.pa.us> <458DE6DB.2060609@araisoft.com>
* 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