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

Re: Inconsistant use of index.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Mayer <ron(at)intervideo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Inconsistant use of index.
Date: 2002-04-03 20:22:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Ron Mayer <ron(at)intervideo(dot)com> writes:
> I did quite a bit more playing with this, and no matter what the
> correlation was (1, -0.001), it never seemed to have any effect
> at all on the execution plan.

> Should it?  With a high correlation the index scan is a much better choice.

I'm confused.  Your examples show the planner correctly estimating the
indexscan as much cheaper than the seqscan.

> logs2=#  explain analyze select count(*) from fact_by_dat where dat='2002-03-01';
> Aggregate  (cost=380347.31..380347.31 rows=1 width=0) (actual time=77785.14..77785.14 rows=1 loops=1)
>   ->  Seq Scan on fact  (cost=0.00..379816.25 rows=212423 width=0) (actual time=20486.16..77420.05 rows=180295 loops=1)
> Total runtime: 77785.28 msec

Cut-and-paste mistake here somewhere, perhaps?  The plan refers to fact
not fact_by_dat.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: ystein ThorsenDate: 2002-04-03 20:40:30
Subject: a problem with case in psql
Previous:From: Ron MayerDate: 2002-04-03 19:14:27
Subject: Re: Inconsistant use of index.

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