Re: Question about explain of index scan

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)skype(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question about explain of index scan
Date: 2005-09-02 14:56:56
Message-ID: 20050902145656.GD18258@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 02, 2005 at 10:31:45AM -0400, Tom Lane wrote:
> Hannu Krosing <hannu(at)skype(dot)net> writes:
> > 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'))
> > )
>
> > Will the same range be scanned 4 times ?
>
> Yes. However, I don't understand how you got that result; AFAIK the
> planner should have eliminated the duplicate subclauses.

Maybe it has to do with the xxid datatype Slony-I adds; maybe it's
missing some operator or property.

I wonder why we don't support more operators on Xid, so these things are
avoided? Right now we only have =, AFAIR.

--
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-02 15:03:24 Re: Question about explain of index scan
Previous Message Alvaro Herrera 2005-09-02 14:54:45 Re: PL/pgSQL: EXCEPTION NOSAVEPOINT