pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: lionel duboeuf <lionel.duboeuf@boozter.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Almost infinite query -> Different Query Plan when changing where clause value
Date: Fri, 12 Feb 2010 14:59:49 -0600
Message-ID: <4B756CE5020000250002F27C@gw.wicourts.gov> (raw)
In-Reply-To: <4B75BADE.9030906@boozter.com>
References: <4B755913.7090004@boozter.com>
	<4B7519C5020000250002F242@gw.wicourts.gov>
	<4B75BADE.9030906@boozter.com>

lionel duboeuf <lionel.duboeuf@boozter.com> wrote:
> Thanks kevin for your answer. Here is some additionnal
> informations attached as files.
 
Could you supply an EXPLAIN ANALYZE of the fast plan as an
attachment, for comparison?
 
Anyway, it looks like at least one big problem is the bad estimate
on how many rows will be generated by joining to the users5_ table:

> (cost=13.20..1427.83 rows=1 width=24)
> (actual time=1.374..517.662 rows=122850 loops=1)

If it had expected 122850 rows to qualify for that join, it probably
would have picked a different plan.
 
I just reread your original email, and I'm not sure I understand
what you meant regarding VACUUM ANALYZE.  If you run that right
beforehand, do you still get the slow plan for user 10?
 
-Kevin



view thread (12+ messages)  latest in thread

Message-ID: <4B756CE5020000250002F27C@gw.wicourts.gov>
Permalink:  ../4B756CE5020000250002F27C@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4B756CE5020000250002F27C@gw.wicourts.gov

 · 

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 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-performance@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, lionel.duboeuf@boozter.com
  Subject: Re: Almost infinite query -> Different Query Plan when changing where clause value
  In-Reply-To: <4B756CE5020000250002F27C@gw.wicourts.gov>
  References: <4B755913.7090004@boozter.com> <4B7519C5020000250002F242@gw.wicourts.gov> <4B75BADE.9030906@boozter.com> <4B756CE5020000250002F27C@gw.wicourts.gov>

* 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