Re: Help Me Understand Why I'm Getting a Bad Query Plan - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Help Me Understand Why I'm Getting a Bad Query Plan
Date
Msg-id 49CAA85C.8080402@agliodbs.com
Whole thread Raw
In response to Re: Help Me Understand Why I'm Getting a Bad Query Plan  (Bryan Murphy <bmurphy1976@gmail.com>)
Responses Re: Help Me Understand Why I'm Getting a Bad Query Plan
List 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


pgsql-performance by date:

Previous
From: Bryan Murphy
Date:
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
Next
From: Bryan Murphy
Date:
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan