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: Column correlation drifts, index ignored again
Date: Sun, 22 Feb 2004 19:09:07 -0500
Message-ID: <BC5EAED3.2DCDA%siracusa@mindspring.com> (raw)
In-Reply-To: <19441.1077493226@sss.pgh.pa.us>

On 2/22/04 6:40 PM, Tom Lane wrote:
> John Siracusa <siracusa@mindspring.com> writes:
>> I think the key is to get the planner to correctly ballpark the number of
>> rows in the date range.
> 
> I thought it was.  What you showed was
> 
> -> Index Scan using mytable_date_idx on mytable (cost=0.00..3071.70 rows=52155
> width=23) (actual time=2.610..1688.111 rows=49679 loops=1)
> 
> which seemed plenty close enough to me.

That's after the planner correctly chooses the date index.  Unfortunately, I
forgot to save the EXPLAIN output from when it was choosing seqscan instead.
Does the planner get estimates from both plans before deciding whether or
not to use the one that references the date index?

-John




view thread (16+ messages)  latest in thread

Message-ID: <BC5EAED3.2DCDA%siracusa@mindspring.com>
Permalink:  ../BC5EAED3.2DCDA%25siracusa@mindspring.com/
Also on:    postgresql.org/message-id/BC5EAED3.2DCDA%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: Column correlation drifts, index ignored again
  In-Reply-To: <BC5EAED3.2DCDA%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