pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Siracusa <siracusa@mindspring.com>
To: Postgres Performance <pgsql-performance@postgresql.org>
Subject: Re: Use my (date) index, darn it!
Date: Mon, 05 Jan 2004 11:19:04 -0500
Message-ID: <BC1EF8A8.712CE%siracusa@mindspring.com> (raw)
In-Reply-To: <22764.1073285743@sss.pgh.pa.us>

On 1/5/04 1:55 AM, Tom Lane wrote:
> John Siracusa <siracusa@mindspring.com> writes:
>> Obviously the planner is making some bad choices here.
> 
> A fair conclusion ...
> 
>> I know that it is trying to avoid random seeks or other scary things
>> implied by a "correlation" statistic that is not close to 1 or -1, but
>> it is massively overestimating the hit caused by those seeks and
>> seemingly not taking into account the size of the table!
> 
> You haven't given any evidence to support these conclusions, though.

Well here's what I was basing that theory on: before clustering, the
correlation for the date column was around 0.3.  After clustering, it was 1,
and the index was always used.  Does clustering change any other statistics
other that correlation?  I ran analyze immediately before and after the
cluster operation.

> Could we see some table schemas, EXPLAIN ANALYZE output, and relevant
> pg_stats entries for the various cases?

Well, the table is clustered now, so I can't reproduce the situation.  Is
there any way to "uncluster" a table?  Should I just cluster it on a
different column?

-John




view thread (7+ messages)  latest in thread

Message-ID: <BC1EF8A8.712CE%siracusa@mindspring.com>
Permalink:  ../BC1EF8A8.712CE%25siracusa@mindspring.com/
Also on:    postgresql.org/message-id/BC1EF8A8.712CE%siracusa@mindspring.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: siracusa@mindspring.com
  Subject: Re: Use my (date) index, darn it!
  In-Reply-To: <BC1EF8A8.712CE%siracusa@mindspring.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