Re: When are index scans used over seq scans?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard van den Berg <richard(dot)vandenberg(at)trust-factory(dot)com>
Cc: pgsql-perform <pgsql-performance(at)postgresql(dot)org>
Subject: Re: When are index scans used over seq scans?
Date: 2005-04-21 16:23:31
Message-ID: 16775.1114100611@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Richard van den Berg <richard(dot)vandenberg(at)trust-factory(dot)com> writes:
> Tom Lane wrote:
>> Perhaps you are incurring a datatype conversion cost?

> Not that I can tell.

No, apparently not. Hmm ... timestamp_cmp_internal is just a couple of
isnan() checks and one or two floating-point compares. Should be pretty
dang cheap. Unless isnan() is ridiculously expensive on your hardware?
More likely there is some bottleneck that we are not thinking of.

Are the tables in question particularly wide (many columns)?

>> which leads me to question what exactly is happening in those
>> comparisons.

> Your guess is as good as mine (actually, yours is much better). I can
> put together a reproducable test case if you like..

I'm thinking it would be interesting to look at a gprof profile of the
nestloop case. If you can rebuild with profiling and get one, that
would be fine, or you can make up a test case that shows the same slow
joining behavior.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bill Chandler 2005-04-21 17:00:18 Index bloat problem?
Previous Message Richard van den Berg 2005-04-21 16:16:45 Re: When are index scans used over seq scans?