Re: patch for between symmetric, asymmetric (from TODO) - Mailing list pgsql-patches

From Tom Lane
Subject Re: patch for between symmetric, asymmetric (from TODO)
Date
Msg-id 14676.1117641749@sss.pgh.pa.us
Whole thread Raw
In response to Re: patch for between symmetric, asymmetric (from TODO)  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
List pgsql-patches
Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
>  Bitmap Heap Scan on fx  (cost=12.00..473.00 rows=998 width=4) (actual
> time=0.516..3.855 rows=1035 loops=1)
>    Recheck Cond: (((i >= 1) AND (i <= 10)) OR ((i >= 10) AND (i <= 1)))
>    ->  BitmapOr  (cost=12.00..12.00 rows=1000 width=0) (actual
> time=0.377..0.377 rows=0 loops=1)
>          ->  Bitmap Index Scan on fxxx  (cost=0.00..6.00 rows=500 width=0)
> (actual time=0.362..0.362 rows=1035 loops=1)
>                Index Cond: ((i >= 1) AND (i <= 10))
>          ->  Bitmap Index Scan on fxxx  (cost=0.00..6.00 rows=500 width=0)
> (actual time=0.007..0.007 rows=0 loops=1)
>                Index Cond: ((i >= 10) AND (i <= 1))
>  Total runtime: 6.412 ms

> better is sort operands before and next test. Without it, between produce
> condition which is allways false. But planner dont recognize it.

No, but the btree index code does --- notice the very small actual time
there.  I don't think there's anything seriously wrong with the above
plan.

            regards, tom lane

pgsql-patches by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: patch for between symmetric, asymmetric (from TODO)
Next
From: Pavel Stehule
Date:
Subject: patch between symmetric (add doc)