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

Re: Help Me Understand Why I'm Getting a Bad Query Plan

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Bryan Murphy <bmurphy1976(at)gmail(dot)com>
Cc: marcin mank <marcin(dot)mank(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
Date: 2009-03-25 21:55:40
Message-ID: 49CAA85C.8080402@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-performance
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


In response to

Responses

pgsql-performance by date

Next:From: Bryan MurphyDate: 2009-03-25 22:14:45
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
Previous:From: Bryan MurphyDate: 2009-03-25 17:53:35
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan

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