pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Bryan Murphy <bmurphy1976@gmail.com>
Cc: marcin mank <marcin.mank@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
Date: Wed, 25 Mar 2009 14:55:40 -0700
Message-ID: <49CAA85C.8080402@agliodbs.com> (raw)
In-Reply-To: <7fd310d10903242047t1a7b7daw1d61c3de7f20b7c6@mail.gmail.com>
References: <7fd310d10903231203r1bd37b8cn8baeadae83253f44@mail.gmail.com>
	<7fd310d10903241521v1cbf5d7aueca653e03ed98649@mail.gmail.com>
	<b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com>
	<7fd310d10903242047t1a7b7daw1d61c3de7f20b7c6@mail.gmail.com>

Bryan,

> One thing to keep in mind, due to a lapse in our judgement at the
> time, this itemexperiencelog table serves as both a current state
> table, and a log table.  Therefore, it potentially has multiple
> redundant entries, but we typically only look at the most recent entry
> to figure out the state of the current item.

Oh, I see.  It thinks that it'll need to pull 260,000 redundant rows in 
order to get 1800 unique ones.  Only it's wrong; you're only pulling 
about 4000.

Try increasing some stats still further: itemexperiencelog.visitorid and 
visitors.user_id both to 500.

--Josh




view thread (14+ messages)  latest in thread

Message-ID: <49CAA85C.8080402@agliodbs.com>
Permalink:  ../49CAA85C.8080402@agliodbs.com/
Also on:    postgresql.org/message-id/49CAA85C.8080402@agliodbs.com

 · 

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: josh@agliodbs.com, bmurphy1976@gmail.com, marcin.mank@gmail.com
  Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
  In-Reply-To: <49CAA85C.8080402@agliodbs.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