Re: *very* slow query to summarize data for a month ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: *very* slow query to summarize data for a month ...
Date: 2003-11-10 23:42:09
Message-ID: 16200.1068507729@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Neil Conway <neilc(at)samurai(dot)com> writes:
> Interesting that we get the row count estimate for this index scan so
> wrong -- I believe this is the root of the problem. Hmmm... I would
> guess that the optimizer stats we have for estimating the selectivity
> of a functional index is pretty primitive, but I haven't looked into
> it at all. Tom might be able to shed some light...

Try "none at all". I have speculated in the past that it would be worth
gathering statistics about the contents of functional indexes, but it's
still on the to-do-someday list.

>> -> Seq Scan on traffic_logs ts (cost=0.00..38340.72 rows=8213 width=16) (actual time=5.02..-645982.04 rows=462198 loops=1)

> Uh, what?

That is bizarre, all right. Is it reproducible?

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Marc G. Fournier 2003-11-11 00:19:56 Re: *very* slow query to summarize data for a month ...
Previous Message Neil Conway 2003-11-10 23:15:41 Re: *very* slow query to summarize data for a month ...