Question about explain of index scan - Mailing list pgsql-hackers

From Hannu Krosing
Subject Question about explain of index scan
Date
Msg-id 1125642986.5013.39.camel@fuji.krosing.net
Whole thread Raw
Responses Re: Question about explain of index scan
List pgsql-hackers
How does Index scan perform a scan for overlapping Index Cond ?

If I get a plan like this, what will actually be performed if EXPLAIN
shows this:
Sort  (cost=12.90..12.91 rows=1 width=207)  Sort Key: log_actionseq  ->  Index Scan using sl_log_1_idx2_hu,
sl_log_1_idx2_hu,
sl_log_1_idx2_hu, sl_log_1_idx2_hu on sl_log_1  (cost=0.00..12.89 rows=1
width=207)        Index Cond: (  ((log_xid < '1349053093') AND (log_xid >= '1349052761')) 
OR ((log_xid < '1349053093') AND (log_xid >= '1349052761')) 
OR ((log_xid < '1349053093') AND (log_xid >= '1349052761')) 
OR ((log_xid < '1349053093') AND (log_xid >= '1349052761'))                    )

(this is from a query generated by Slony for 4 sets replicated from the
same master)

Will the same range be scanned 4 times ?

Or is the scan method smart enough to collapse them into one pass ?

Or does this actually mean 4 conactenated index scans (Index Scan using
X, X, X, X on sl_log_1) ?

-- 
Hannu Krosing <hannu@skype.net>



pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: Two different defs of MAX_TUPLES_PER_PAGE
Next
From: Martijn van Oosterhout
Date:
Subject: Proof of concept COLLATE support with patch