Skip site navigation (1) Skip section navigation (2)

Re: Query w empty result set with LIMIT orders of magnitude slower than without

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Frank Joerdens" <frank(at)joerdens(dot)de>
Cc: pgsql-performance(at)postgresql(dot)org, Nic <nferrier(at)tapsellferrier(dot)co(dot)uk>, "Seb Potter" <seb(at)woome(dot)com>
Subject: Re: Query w empty result set with LIMIT orders of magnitude slower than without
Date: 2008-08-26 16:53:09
Message-ID: 10025.1219769589@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Frank Joerdens" <frank(at)joerdens(dot)de> writes:
> It seems to me that the planner makes a very poor decision with this
> particular query:

Try increasing the stats on woouser.  You need it to make a smaller
estimate of the number of matching rows here:

>                ->  Index Scan Backward using webapp_invite_pkey on
> webapp_invite  (cost=0.00..201698.51 rows=382 width=44) (actual
> time=2545.131..2545.131 rows=0 loops=1)
>                      Filter: ((woouser)::text = 'suggus'::text)

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Frank JoerdensDate: 2008-08-26 16:59:49
Subject: Re: Query w empty result set with LIMIT orders of magnitude slower than without (SOLVED, pls disregard)
Previous:From: Jerry ChamplinDate: 2008-08-26 16:45:31
Subject: Re: Autovacuum does not stay turned off

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group