Re: Query w empty result set with LIMIT orders of magnitude slower than without - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query w empty result set with LIMIT orders of magnitude slower than without
Date
Msg-id 10025.1219769589@sss.pgh.pa.us
Whole thread Raw
In response to Query w empty result set with LIMIT orders of magnitude slower than without  ("Frank Joerdens" <frank@joerdens.de>)
Responses Re: Query w empty result set with LIMIT orders of magnitude slower than without
List pgsql-performance
"Frank Joerdens" <frank@joerdens.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

pgsql-performance by date:

Previous
From: Jerry Champlin
Date:
Subject: Re: Autovacuum does not stay turned off
Next
From: "Frank Joerdens"
Date:
Subject: Re: Query w empty result set with LIMIT orders of magnitude slower than without (SOLVED, pls disregard)