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

consequent btree index scans optimizations ?

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: consequent btree index scans optimizations ?
Date: 2005-03-03 15:43:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hi there,

I'm trying to understand if I have something to optimize in my
query which is basically looks like a bunch of many intervals:

    (ipix >= 341288409261670400 AND ipix < 341358778005848064)
OR (ipix >= 341710621726736384 AND ipix < 341728213912780800)
OR (ipix >= 341728213912780800 AND ipix < 341745806098825216)
OR (ipix >= 340531945261760512 AND ipix < 340549537447804928)
OR (ipix >= 340567129633849344 AND ipix < 340584721819893760)

Table is rather big  (> 500 mln rows) and clustered by 
btree index on ipix.  Generally I'm quite satisfied with
performance, but I'm wondering if optimizer take order of intervals 
into account ? 
Looking into pg_stat_user_tables
I see there were 168 index scans which is exactly the number of
intervals and 98530 tuples fetched. Since table is clustered hit
ratio is very good and execution time is < 0.5s.

Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su,
phone: +007(095)939-16-83, +007(095)939-23-83

pgsql-hackers by date

Next:From: Greg StarkDate: 2005-03-03 16:08:36
Subject: Re: 8.0.X and the ARC patent
Previous:From: Oleg BartunovDate: 2005-03-03 15:29:55
Subject: cluster table by two-column index ?

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