Re: Query Optimizer makes a poor choice

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query Optimizer makes a poor choice
Date: 2011-11-29 22:19:43
Message-ID: 4ED55A7F.3010306@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

what PostgreSQL version is this? That's the first thing we need to know.

On 29.11.2011 22:28, Tyler Hains wrote:
> Yes, I'm pretty sure autovacuum is enabled. Changing the query as shown
> there uses the sub-optimal index.

That doesn't mean

> I haven't had a chance to experiment with the SET STATISTICS, but that
> got me going on something interesting...

If you execute this

SELECT count(*) FROM cards WHERE card_set_id=2850;

what number do you get? How far is that from 27616, expected by the planner?

> Do these statistics look right?

No idea, that depends on your data set. And you've missed the
most_common_freqs so it's almost impossible to analyze the stats.

Tomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2011-11-29 22:28:01 Re: Query Optimizer makes a poor choice
Previous Message Heiko Wundram 2011-11-29 22:18:43 Re: Limiting number of connections to PostgreSQL per IP (not per DB/user)?