Re: again on index usage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: again on index usage
Date
Msg-id 20453.1010674990@sss.pgh.pa.us
Whole thread Raw
In response to Re: again on index usage  (Daniel Kalchev <daniel@digsys.bg>)
Responses Re: again on index usage  (Daniel Kalchev <daniel@digsys.bg>)
List pgsql-hackers
Daniel Kalchev <daniel@digsys.bg> writes:
> I agree, that with the 'wrong' clustering the index scan is not so
> much faster than the sequential scan.

It would be interesting to check whether there is any correlation
between ipaddr and ipdate in your test data.  Perhaps clustering
on ipaddr might not destroy the ordering on ipdate as much as you
thought.  A more clearly random-order test would go:

select * into iplog_test from iplog_gate200112 order by random();
create index iplog_test_ipdate_idx on iplog_test(ipdate);
vacuum verbose analyze iplog_test;
<< run queries >>

> Perhaps I need to tune this machine's costs to prefer more disk intensive 
> operations over CPU intensive operations?

Possibly.  I'm not sure there's much point in tuning the cost estimates
until the underlying model is more nearly right (ie, knows something
about correlation).  Do you care to try your dataset with 7.2 beta?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alessio Bragadini
Date:
Subject: Re: Usenet service (was: RC1 time?)
Next
From: Tom Lane
Date:
Subject: Re: seq scan startup cost