pgsql: Improve implementation of range-contains-element tests.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve implementation of range-contains-element tests.
Date: 2011-11-22 22:45:57
Message-ID: E1RSz6D-0000Qe-Hz@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve implementation of range-contains-element tests.

Implement these tests directly instead of constructing a singleton range
and then applying range-contains. This saves a range serialize/deserialize
cycle as well as a couple of redundant bound-comparison steps, and adds
very little code on net.

Remove elem_contained_by_range from the GiST opclass: it doesn't belong
there because there is no way to use it in an index clause (where the
indexed column would have to be on the left). Its commutator is in the
opclass, and that's what counts.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cddc819e45010492da00164d225a749661f43aef

Modified Files
--------------
src/backend/utils/adt/rangetypes.c | 65 ++++++++++++++-----
src/backend/utils/adt/rangetypes_gist.c | 105 ++++++++++++------------------
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_amop.h | 1 -
src/test/regress/expected/opr_sanity.out | 3 +-
5 files changed, 92 insertions(+), 84 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Hiroshi Saito 2011-11-22 23:19:50 psqlodbc - psqlodbc: add the change history.
Previous Message User Hinoue 2011-11-22 21:50:13 psqlodbc - psqlodbc: Clear col_info(columns info) cache ehen DROP/ALTER