pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Frank Joerdens <frank@joerdens.de>
Cc: pgsql-performance@postgresql.org, Nic <nferrier@tapsellferrier.co.uk>
Cc: Seb Potter <seb@woome.com>
Subject: Re: Query w empty result set with LIMIT orders of magnitude slower than without
Date: Tue, 26 Aug 2008 12:53:09 -0400
Message-ID: <10025.1219769589@sss.pgh.pa.us> (raw)
In-Reply-To: <7d10d2df0808260937v3103e216h764bbb74ca597d6f@mail.gmail.com>
References: <7d10d2df0808260937v3103e216h764bbb74ca597d6f@mail.gmail.com>

"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



view thread (4+ messages)  latest in thread

Message-ID: <10025.1219769589@sss.pgh.pa.us>
Permalink:  ../10025.1219769589@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10025.1219769589@sss.pgh.pa.us

 · 

reply

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, frank@joerdens.de, nferrier@tapsellferrier.co.uk, seb@woome.com
  Subject: Re: Query w empty result set with LIMIT orders of magnitude slower than without
  In-Reply-To: <10025.1219769589@sss.pgh.pa.us>

* 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