Commit 0cc99327 authored by Tom Lane's avatar Tom Lane

Rename the "point is strictly above/below point" comparison operators.

Historically these were called >^ and <^, but that is inconsistent
with the similar box, polygon, and circle operators, which are named
|>> and <<| respectively.  Worse, the >^ and <^ names are used for
*not* strict above/below tests for the box type.

Hence, invent new operators following the more common naming.  The
old operators remain available for now, and are still accepted by
the relevant index opclasses too.  But there's a deprecation notice,
so maybe we can get rid of them someday.

Emre Hasegeli, reviewed by Pavel Borisov

Discussion: https://postgr.es/m/24348.1587444160@sss.pgh.pa.us
parent d36228a9
...@@ -10609,7 +10609,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple ...@@ -10609,7 +10609,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
</para> </para>
<para> <para>
Is first object strictly below second? Is first object strictly below second?
Available for <type>box</type>, <type>polygon</type>, Available for <type>point</type>, <type>box</type>, <type>polygon</type>,
<type>circle</type>. <type>circle</type>.
</para> </para>
<para> <para>
...@@ -10625,7 +10625,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple ...@@ -10625,7 +10625,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
</para> </para>
<para> <para>
Is first object strictly above second? Is first object strictly above second?
Available for <type>box</type>, <type>polygon</type>, Available for <type>point</type>, <type>box</type>, <type>polygon</type>,
<type>circle</type>. <type>circle</type>.
</para> </para>
<para> <para>
...@@ -10680,21 +10680,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple ...@@ -10680,21 +10680,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
</para></entry> </para></entry>
</row> </row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<type>point</type> <literal>&lt;^</literal> <type>point</type>
<returnvalue>boolean</returnvalue>
</para>
<para>
Is first object strictly below second?
(This operator is misnamed; it should be <literal>&lt;&lt;|</literal>.)
</para>
<para>
<literal>point '(1,0)' &lt;^ point '(1,1)'</literal>
<returnvalue>t</returnvalue>
</para></entry>
</row>
<row> <row>
<entry role="func_table_entry"><para role="func_signature"> <entry role="func_table_entry"><para role="func_signature">
<type>box</type> <literal>&gt;^</literal> <type>box</type> <type>box</type> <literal>&gt;^</literal> <type>box</type>
...@@ -10709,21 +10694,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple ...@@ -10709,21 +10694,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
</para></entry> </para></entry>
</row> </row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<type>point</type> <literal>&gt;^</literal> <type>point</type>
<returnvalue>boolean</returnvalue>
</para>
<para>
Is first object strictly above second?
(This operator is misnamed; it should be <literal>|&gt;&gt;</literal>.)
</para>
<para>
<literal>point '(1,1)' &gt;^ point '(1,0)'</literal>
<returnvalue>t</returnvalue>
</para></entry>
</row>
<row> <row>
<entry role="func_table_entry"><para role="func_signature"> <entry role="func_table_entry"><para role="func_signature">
<replaceable>geometric_type</replaceable> <literal>?#</literal> <replaceable>geometric_type</replaceable> <replaceable>geometric_type</replaceable> <literal>?#</literal> <replaceable>geometric_type</replaceable>
...@@ -10877,6 +10847,18 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple ...@@ -10877,6 +10847,18 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
</para> </para>
</caution> </caution>
<note>
<para>
Before <productname>PostgreSQL</productname> 14, the point
is strictly below/above comparison operators <type>point</type>
<literal>&lt;&lt;|</literal> <type>point</type> and <type>point</type>
<literal>|&gt;&gt;</literal> <type>point</type> were respectively
called <literal>&lt;^</literal> and <literal>&gt;^</literal>. These
names are still available, but are deprecated and will eventually be
removed.
</para>
</note>
<table id="functions-geometry-func-table"> <table id="functions-geometry-func-table">
<title>Geometric Functions</title> <title>Geometric Functions</title>
<tgroup cols="1"> <tgroup cols="1">
......
...@@ -118,12 +118,12 @@ ...@@ -118,12 +118,12 @@
<row> <row>
<entry valign="middle" morerows="7"><literal>point_ops</literal></entry> <entry valign="middle" morerows="7"><literal>point_ops</literal></entry>
<entry><literal>&gt;^ (point,point)</literal></entry> <entry><literal>|&gt;&gt; (point,point)</literal></entry>
<entry valign="middle" morerows="7"><literal>&lt;-&gt; (point,point)</literal></entry> <entry valign="middle" morerows="7"><literal>&lt;-&gt; (point,point)</literal></entry>
</row> </row>
<row><entry><literal>&lt;&lt; (point,point)</literal></entry></row> <row><entry><literal>&lt;&lt; (point,point)</literal></entry></row>
<row><entry><literal>&gt;&gt; (point,point)</literal></entry></row> <row><entry><literal>&gt;&gt; (point,point)</literal></entry></row>
<row><entry><literal>&lt;^ (point,point)</literal></entry></row> <row><entry><literal>&lt;&lt;| (point,point)</literal></entry></row>
<row><entry><literal>~= (point,point)</literal></entry></row> <row><entry><literal>~= (point,point)</literal></entry></row>
<row><entry><literal>&lt;@ (point,box)</literal></entry></row> <row><entry><literal>&lt;@ (point,box)</literal></entry></row>
<row><entry><literal>&lt;@ (point,polygon)</literal></entry></row> <row><entry><literal>&lt;@ (point,polygon)</literal></entry></row>
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<row> <row>
<entry valign="middle" morerows="11"><literal>box_ops</literal></entry> <entry valign="middle" morerows="11"><literal>box_ops</literal></entry>
<entry><literal>&lt;&lt; (box,box)</literal></entry> <entry><literal>&lt;&lt; (box,box)</literal></entry>
<entry valign="middle" morerows="11"><literal>&lt;-&gt; (box,point)</literal></entry> <entry valign="middle" morerows="11"><literal>&lt;-&gt; (box,point)</literal></entry>
</row> </row>
<row><entry><literal>&amp;&lt; (box,box)</literal></entry></row> <row><entry><literal>&amp;&lt; (box,box)</literal></entry></row>
<row><entry><literal>&amp;&gt; (box,box)</literal></entry></row> <row><entry><literal>&amp;&gt; (box,box)</literal></entry></row>
...@@ -92,12 +92,12 @@ ...@@ -92,12 +92,12 @@
<row> <row>
<entry valign="middle" morerows="5"><literal>kd_point_ops</literal></entry> <entry valign="middle" morerows="5"><literal>kd_point_ops</literal></entry>
<entry><literal>&gt;^ (point,point)</literal></entry> <entry><literal>|&gt;&gt; (point,point)</literal></entry>
<entry valign="middle" morerows="5"><literal>&lt;-&gt; (point,point)</literal></entry> <entry valign="middle" morerows="5"><literal>&lt;-&gt; (point,point)</literal></entry>
</row> </row>
<row><entry><literal>&lt;&lt; (point,point)</literal></entry></row> <row><entry><literal>&lt;&lt; (point,point)</literal></entry></row>
<row><entry><literal>&gt;&gt; (point,point)</literal></entry></row> <row><entry><literal>&gt;&gt; (point,point)</literal></entry></row>
<row><entry><literal>&lt;^ (point,point)</literal></entry></row> <row><entry><literal>&lt;&lt;| (point,point)</literal></entry></row>
<row><entry><literal>~= (point,point)</literal></entry></row> <row><entry><literal>~= (point,point)</literal></entry></row>
<row><entry><literal>&lt;@ (point,box)</literal></entry></row> <row><entry><literal>&lt;@ (point,box)</literal></entry></row>
...@@ -132,16 +132,16 @@ ...@@ -132,16 +132,16 @@
<row><entry><literal>&lt;&lt;| (polygon,polygon)</literal></entry></row> <row><entry><literal>&lt;&lt;| (polygon,polygon)</literal></entry></row>
<row><entry><literal>&amp;&lt;| (polygon,polygon)</literal></entry></row> <row><entry><literal>&amp;&lt;| (polygon,polygon)</literal></entry></row>
<row><entry><literal>|&gt;&gt; (polygon,polygon)</literal></entry></row> <row><entry><literal>|&gt;&gt; (polygon,polygon)</literal></entry></row>
<row><entry><literal>|&amp;&gt; (polygon,polygon)</literal></entry></row> <row><entry><literal>|&amp;&gt; (polygon,polygon)</literal></entry></row>
<row> <row>
<entry valign="middle" morerows="5"><literal>quad_point_ops</literal></entry> <entry valign="middle" morerows="5"><literal>quad_point_ops</literal></entry>
<entry><literal>&gt;^ (point,point)</literal></entry> <entry><literal>|&gt;&gt; (point,point)</literal></entry>
<entry valign="middle" morerows="5"><literal>&lt;-&gt; (point,point)</literal></entry> <entry valign="middle" morerows="5"><literal>&lt;-&gt; (point,point)</literal></entry>
</row> </row>
<row><entry><literal>&lt;&lt; (point,point)</literal></entry></row> <row><entry><literal>&lt;&lt; (point,point)</literal></entry></row>
<row><entry><literal>&gt;&gt; (point,point)</literal></entry></row> <row><entry><literal>&gt;&gt; (point,point)</literal></entry></row>
<row><entry><literal>&lt;^ (point,point)</literal></entry></row> <row><entry><literal>&lt;&lt;| (point,point)</literal></entry></row>
<row><entry><literal>~= (point,point)</literal></entry></row> <row><entry><literal>~= (point,point)</literal></entry></row>
<row><entry><literal>&lt;@ (point,box)</literal></entry></row> <row><entry><literal>&lt;@ (point,box)</literal></entry></row>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<row><entry><literal>&amp;&lt; (anyrange,anyrange)</literal></entry></row> <row><entry><literal>&amp;&lt; (anyrange,anyrange)</literal></entry></row>
<row><entry><literal>&amp;&gt; (anyrange,anyrange)</literal></entry></row> <row><entry><literal>&amp;&gt; (anyrange,anyrange)</literal></entry></row>
<row><entry><literal>-|- (anyrange,anyrange)</literal></entry></row> <row><entry><literal>-|- (anyrange,anyrange)</literal></entry></row>
<row> <row>
<entry valign="middle" morerows="9"><literal>text_ops</literal></entry> <entry valign="middle" morerows="9"><literal>text_ops</literal></entry>
<entry><literal>= (text,text)</literal></entry> <entry><literal>= (text,text)</literal></entry>
......
...@@ -1341,8 +1341,18 @@ gist_point_consistent(PG_FUNCTION_ARGS) ...@@ -1341,8 +1341,18 @@ gist_point_consistent(PG_FUNCTION_ARGS)
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool *recheck = (bool *) PG_GETARG_POINTER(4); bool *recheck = (bool *) PG_GETARG_POINTER(4);
bool result; bool result;
StrategyNumber strategyGroup = strategy / GeoStrategyNumberOffset; StrategyNumber strategyGroup;
/*
* We have to remap these strategy numbers to get this klugy
* classification logic to work.
*/
if (strategy == RTOldBelowStrategyNumber)
strategy = RTBelowStrategyNumber;
else if (strategy == RTOldAboveStrategyNumber)
strategy = RTAboveStrategyNumber;
strategyGroup = strategy / GeoStrategyNumberOffset;
switch (strategyGroup) switch (strategyGroup)
{ {
case PointStrategyNumberGroup: case PointStrategyNumberGroup:
......
...@@ -209,10 +209,12 @@ spg_kd_inner_consistent(PG_FUNCTION_ARGS) ...@@ -209,10 +209,12 @@ spg_kd_inner_consistent(PG_FUNCTION_ARGS)
} }
break; break;
case RTBelowStrategyNumber: case RTBelowStrategyNumber:
case RTOldBelowStrategyNumber:
if ((in->level % 2) == 0 && FPlt(query->y, coord)) if ((in->level % 2) == 0 && FPlt(query->y, coord))
which &= (1 << 1); which &= (1 << 1);
break; break;
case RTAboveStrategyNumber: case RTAboveStrategyNumber:
case RTOldAboveStrategyNumber:
if ((in->level % 2) == 0 && FPgt(query->y, coord)) if ((in->level % 2) == 0 && FPgt(query->y, coord))
which &= (1 << 2); which &= (1 << 2);
break; break;
......
...@@ -316,10 +316,12 @@ spg_quad_inner_consistent(PG_FUNCTION_ARGS) ...@@ -316,10 +316,12 @@ spg_quad_inner_consistent(PG_FUNCTION_ARGS)
which &= (1 << getQuadrant(centroid, query)); which &= (1 << getQuadrant(centroid, query));
break; break;
case RTBelowStrategyNumber: case RTBelowStrategyNumber:
case RTOldBelowStrategyNumber:
if (SPTEST(point_above, centroid, query)) if (SPTEST(point_above, centroid, query))
which &= (1 << 2) | (1 << 3); which &= (1 << 2) | (1 << 3);
break; break;
case RTAboveStrategyNumber: case RTAboveStrategyNumber:
case RTOldAboveStrategyNumber:
if (SPTEST(point_below, centroid, query)) if (SPTEST(point_below, centroid, query))
which &= (1 << 1) | (1 << 4); which &= (1 << 1) | (1 << 4);
break; break;
...@@ -434,9 +436,11 @@ spg_quad_leaf_consistent(PG_FUNCTION_ARGS) ...@@ -434,9 +436,11 @@ spg_quad_leaf_consistent(PG_FUNCTION_ARGS)
res = SPTEST(point_eq, datum, query); res = SPTEST(point_eq, datum, query);
break; break;
case RTBelowStrategyNumber: case RTBelowStrategyNumber:
case RTOldBelowStrategyNumber:
res = SPTEST(point_below, datum, query); res = SPTEST(point_below, datum, query);
break; break;
case RTAboveStrategyNumber: case RTAboveStrategyNumber:
case RTOldAboveStrategyNumber:
res = SPTEST(point_above, datum, query); res = SPTEST(point_above, datum, query);
break; break;
case RTContainedByStrategyNumber: case RTContainedByStrategyNumber:
......
...@@ -76,8 +76,10 @@ typedef uint16 StrategyNumber; ...@@ -76,8 +76,10 @@ typedef uint16 StrategyNumber;
#define RTSuperStrategyNumber 26 /* for inet << */ #define RTSuperStrategyNumber 26 /* for inet << */
#define RTSuperEqualStrategyNumber 27 /* for inet >>= */ #define RTSuperEqualStrategyNumber 27 /* for inet >>= */
#define RTPrefixStrategyNumber 28 /* for text ^@ */ #define RTPrefixStrategyNumber 28 /* for text ^@ */
#define RTOldBelowStrategyNumber 29 /* for old spelling of <<| */
#define RTOldAboveStrategyNumber 30 /* for old spelling of |>> */
#define RTMaxStrategyNumber 28 #define RTMaxStrategyNumber 30
#endif /* STRATNUM_H */ #endif /* STRATNUM_H */
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 202011191 #define CATALOG_VERSION_NO 202011231
#endif #endif
...@@ -1111,7 +1111,10 @@ ...@@ -1111,7 +1111,10 @@
# gist point_ops # gist point_ops
{ amopfamily => 'gist/point_ops', amoplefttype => 'point', { amopfamily => 'gist/point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)', amoprighttype => 'point', amopstrategy => '11', amopopr => '|>>(point,point)',
amopmethod => 'gist' },
{ amopfamily => 'gist/point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '30', amopopr => '>^(point,point)',
amopmethod => 'gist' }, amopmethod => 'gist' },
{ amopfamily => 'gist/point_ops', amoplefttype => 'point', { amopfamily => 'gist/point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)', amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)',
...@@ -1120,7 +1123,10 @@ ...@@ -1120,7 +1123,10 @@
amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)', amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)',
amopmethod => 'gist' }, amopmethod => 'gist' },
{ amopfamily => 'gist/point_ops', amoplefttype => 'point', { amopfamily => 'gist/point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)', amoprighttype => 'point', amopstrategy => '10', amopopr => '<<|(point,point)',
amopmethod => 'gist' },
{ amopfamily => 'gist/point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '29', amopopr => '<^(point,point)',
amopmethod => 'gist' }, amopmethod => 'gist' },
{ amopfamily => 'gist/point_ops', amoplefttype => 'point', { amopfamily => 'gist/point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)', amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)',
...@@ -1370,7 +1376,10 @@ ...@@ -1370,7 +1376,10 @@
# SP-GiST quad_point_ops # SP-GiST quad_point_ops
{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)', amoprighttype => 'point', amopstrategy => '11', amopopr => '|>>(point,point)',
amopmethod => 'spgist' },
{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '30', amopopr => '>^(point,point)',
amopmethod => 'spgist' }, amopmethod => 'spgist' },
{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)', amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)',
...@@ -1379,7 +1388,10 @@ ...@@ -1379,7 +1388,10 @@
amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)', amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)',
amopmethod => 'spgist' }, amopmethod => 'spgist' },
{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)', amoprighttype => 'point', amopstrategy => '10', amopopr => '<<|(point,point)',
amopmethod => 'spgist' },
{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '29', amopopr => '<^(point,point)',
amopmethod => 'spgist' }, amopmethod => 'spgist' },
{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)', amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)',
...@@ -1394,7 +1406,10 @@ ...@@ -1394,7 +1406,10 @@
# SP-GiST kd_point_ops # SP-GiST kd_point_ops
{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)', amoprighttype => 'point', amopstrategy => '11', amopopr => '|>>(point,point)',
amopmethod => 'spgist' },
{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '30', amopopr => '>^(point,point)',
amopmethod => 'spgist' }, amopmethod => 'spgist' },
{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)', amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)',
...@@ -1403,7 +1418,10 @@ ...@@ -1403,7 +1418,10 @@
amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)', amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)',
amopmethod => 'spgist' }, amopmethod => 'spgist' },
{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)', amoprighttype => 'point', amopstrategy => '10', amopopr => '<<|(point,point)',
amopmethod => 'spgist' },
{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '29', amopopr => '<^(point,point)',
amopmethod => 'spgist' }, amopmethod => 'spgist' },
{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)', amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)',
......
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
oprname => '<=', oprleft => 'box', oprright => 'box', oprresult => 'bool', oprname => '<=', oprleft => 'box', oprright => 'box', oprresult => 'bool',
oprcom => '>=(box,box)', oprnegate => '>(box,box)', oprcode => 'box_le', oprcom => '>=(box,box)', oprnegate => '>(box,box)', oprcode => 'box_le',
oprrest => 'areasel', oprjoin => 'areajoinsel' }, oprrest => 'areasel', oprjoin => 'areajoinsel' },
{ oid => '506', descr => 'is above', { oid => '506', descr => 'deprecated, use |>> instead',
oprname => '>^', oprleft => 'point', oprright => 'point', oprresult => 'bool', oprname => '>^', oprleft => 'point', oprright => 'point', oprresult => 'bool',
oprcode => 'point_above', oprrest => 'positionsel', oprcode => 'point_above', oprrest => 'positionsel',
oprjoin => 'positionjoinsel' }, oprjoin => 'positionjoinsel' },
...@@ -407,7 +407,7 @@ ...@@ -407,7 +407,7 @@
oprname => '>>', oprleft => 'point', oprright => 'point', oprresult => 'bool', oprname => '>>', oprleft => 'point', oprright => 'point', oprresult => 'bool',
oprcode => 'point_right', oprrest => 'positionsel', oprcode => 'point_right', oprrest => 'positionsel',
oprjoin => 'positionjoinsel' }, oprjoin => 'positionjoinsel' },
{ oid => '509', descr => 'is below', { oid => '509', descr => 'deprecated, use <<| instead',
oprname => '<^', oprleft => 'point', oprright => 'point', oprresult => 'bool', oprname => '<^', oprleft => 'point', oprright => 'point', oprresult => 'bool',
oprcode => 'point_below', oprrest => 'positionsel', oprcode => 'point_below', oprrest => 'positionsel',
oprjoin => 'positionjoinsel' }, oprjoin => 'positionjoinsel' },
...@@ -1878,6 +1878,15 @@ ...@@ -1878,6 +1878,15 @@
oprname => '#', oprleft => 'line', oprright => 'line', oprresult => 'point', oprname => '#', oprleft => 'line', oprright => 'line', oprresult => 'point',
oprcom => '#(line,line)', oprcode => 'line_interpt' }, oprcom => '#(line,line)', oprcode => 'line_interpt' },
{ oid => '4161', descr => 'is above',
oprname => '|>>', oprleft => 'point', oprright => 'point',
oprresult => 'bool', oprcode => 'point_above', oprrest => 'positionsel',
oprjoin => 'positionjoinsel' },
{ oid => '4162', descr => 'is below',
oprname => '<<|', oprleft => 'point', oprright => 'point',
oprresult => 'bool', oprcode => 'point_below', oprrest => 'positionsel',
oprjoin => 'positionjoinsel' },
# MACADDR type # MACADDR type
{ oid => '1220', descr => 'equal', { oid => '1220', descr => 'equal',
oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'macaddr', oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'macaddr',
......
...@@ -160,13 +160,13 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; ...@@ -160,13 +160,13 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
4 4
(1 row) (1 row)
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
count count
------- -------
1 1
(1 row) (1 row)
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
count count
------- -------
5 5
...@@ -470,30 +470,30 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; ...@@ -470,30 +470,30 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
QUERY PLAN QUERY PLAN
------------------------------------------------------ ------------------------------------------------------
Aggregate Aggregate
-> Index Only Scan using gpointind on point_tbl p -> Index Only Scan using gpointind on point_tbl p
Index Cond: (f1 <^ '(0,0)'::point) Index Cond: (f1 <<| '(0,0)'::point)
(3 rows) (3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
count count
------- -------
1 1
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
QUERY PLAN QUERY PLAN
------------------------------------------------------ ------------------------------------------------------
Aggregate Aggregate
-> Index Only Scan using gpointind on point_tbl p -> Index Only Scan using gpointind on point_tbl p
Index Cond: (f1 >^ '(0,0)'::point) Index Cond: (f1 |>> '(0,0)'::point)
(3 rows) (3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
count count
------- -------
5 5
......
...@@ -62,13 +62,13 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -62,13 +62,13 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
4999 4999
(1 row) (1 row)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
count count
------- -------
5000 5000
(1 row) (1 row)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
count count
------- -------
5999 5999
...@@ -282,30 +282,30 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -282,30 +282,30 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
QUERY PLAN QUERY PLAN
----------------------------------------------------------- -----------------------------------------------------------
Aggregate Aggregate
-> Index Only Scan using sp_quad_ind on quad_point_tbl -> Index Only Scan using sp_quad_ind on quad_point_tbl
Index Cond: (p <^ '(5000,4000)'::point) Index Cond: (p <<| '(5000,4000)'::point)
(3 rows) (3 rows)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
count count
------- -------
5000 5000
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
QUERY PLAN QUERY PLAN
----------------------------------------------------------- -----------------------------------------------------------
Aggregate Aggregate
-> Index Only Scan using sp_quad_ind on quad_point_tbl -> Index Only Scan using sp_quad_ind on quad_point_tbl
Index Cond: (p >^ '(5000,4000)'::point) Index Cond: (p |>> '(5000,4000)'::point)
(3 rows) (3 rows)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
count count
------- -------
5999 5999
...@@ -449,30 +449,30 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -449,30 +449,30 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
QUERY PLAN QUERY PLAN
------------------------------------------------------- -------------------------------------------------------
Aggregate Aggregate
-> Index Only Scan using sp_kd_ind on kd_point_tbl -> Index Only Scan using sp_kd_ind on kd_point_tbl
Index Cond: (p <^ '(5000,4000)'::point) Index Cond: (p <<| '(5000,4000)'::point)
(3 rows) (3 rows)
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
count count
------- -------
5000 5000
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
QUERY PLAN QUERY PLAN
------------------------------------------------------- -------------------------------------------------------
Aggregate Aggregate
-> Index Only Scan using sp_kd_ind on kd_point_tbl -> Index Only Scan using sp_kd_ind on kd_point_tbl
Index Cond: (p >^ '(5000,4000)'::point) Index Cond: (p |>> '(5000,4000)'::point)
(3 rows) (3 rows)
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
count count
------- -------
5999 5999
...@@ -897,34 +897,34 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -897,34 +897,34 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
QUERY PLAN QUERY PLAN
------------------------------------------------------- --------------------------------------------------------
Aggregate Aggregate
-> Bitmap Heap Scan on quad_point_tbl -> Bitmap Heap Scan on quad_point_tbl
Recheck Cond: (p <^ '(5000,4000)'::point) Recheck Cond: (p <<| '(5000,4000)'::point)
-> Bitmap Index Scan on sp_quad_ind -> Bitmap Index Scan on sp_quad_ind
Index Cond: (p <^ '(5000,4000)'::point) Index Cond: (p <<| '(5000,4000)'::point)
(5 rows) (5 rows)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
count count
------- -------
5000 5000
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
QUERY PLAN QUERY PLAN
------------------------------------------------------- --------------------------------------------------------
Aggregate Aggregate
-> Bitmap Heap Scan on quad_point_tbl -> Bitmap Heap Scan on quad_point_tbl
Recheck Cond: (p >^ '(5000,4000)'::point) Recheck Cond: (p |>> '(5000,4000)'::point)
-> Bitmap Index Scan on sp_quad_ind -> Bitmap Index Scan on sp_quad_ind
Index Cond: (p >^ '(5000,4000)'::point) Index Cond: (p |>> '(5000,4000)'::point)
(5 rows) (5 rows)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
count count
------- -------
5999 5999
...@@ -1016,34 +1016,34 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -1016,34 +1016,34 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
QUERY PLAN QUERY PLAN
------------------------------------------------------- --------------------------------------------------------
Aggregate Aggregate
-> Bitmap Heap Scan on kd_point_tbl -> Bitmap Heap Scan on kd_point_tbl
Recheck Cond: (p <^ '(5000,4000)'::point) Recheck Cond: (p <<| '(5000,4000)'::point)
-> Bitmap Index Scan on sp_kd_ind -> Bitmap Index Scan on sp_kd_ind
Index Cond: (p <^ '(5000,4000)'::point) Index Cond: (p <<| '(5000,4000)'::point)
(5 rows) (5 rows)
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
count count
------- -------
5000 5000
(1 row) (1 row)
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
QUERY PLAN QUERY PLAN
------------------------------------------------------- --------------------------------------------------------
Aggregate Aggregate
-> Bitmap Heap Scan on kd_point_tbl -> Bitmap Heap Scan on kd_point_tbl
Recheck Cond: (p >^ '(5000,4000)'::point) Recheck Cond: (p |>> '(5000,4000)'::point)
-> Bitmap Index Scan on sp_kd_ind -> Bitmap Index Scan on sp_kd_ind
Index Cond: (p >^ '(5000,4000)'::point) Index Cond: (p |>> '(5000,4000)'::point)
(5 rows) (5 rows)
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
count count
------- -------
5999 5999
......
...@@ -1985,8 +1985,6 @@ ORDER BY 1, 2, 3; ...@@ -1985,8 +1985,6 @@ ORDER BY 1, 2, 3;
783 | 8 | <@ 783 | 8 | <@
783 | 9 | &<| 783 | 9 | &<|
783 | 10 | <<| 783 | 10 | <<|
783 | 10 | <^
783 | 11 | >^
783 | 11 | |>> 783 | 11 | |>>
783 | 12 | |&> 783 | 12 | |&>
783 | 15 | <-> 783 | 15 | <->
...@@ -2002,6 +2000,8 @@ ORDER BY 1, 2, 3; ...@@ -2002,6 +2000,8 @@ ORDER BY 1, 2, 3;
783 | 26 | >> 783 | 26 | >>
783 | 27 | >>= 783 | 27 | >>=
783 | 28 | <@ 783 | 28 | <@
783 | 29 | <^
783 | 30 | >^
783 | 48 | <@ 783 | 48 | <@
783 | 68 | <@ 783 | 68 | <@
2742 | 1 | && 2742 | 1 | &&
...@@ -2060,9 +2060,7 @@ ORDER BY 1, 2, 3; ...@@ -2060,9 +2060,7 @@ ORDER BY 1, 2, 3;
4000 | 8 | <@ 4000 | 8 | <@
4000 | 9 | &<| 4000 | 9 | &<|
4000 | 10 | <<| 4000 | 10 | <<|
4000 | 10 | <^
4000 | 11 | < 4000 | 11 | <
4000 | 11 | >^
4000 | 11 | |>> 4000 | 11 | |>>
4000 | 12 | <= 4000 | 12 | <=
4000 | 12 | |&> 4000 | 12 | |&>
...@@ -2081,6 +2079,8 @@ ORDER BY 1, 2, 3; ...@@ -2081,6 +2079,8 @@ ORDER BY 1, 2, 3;
4000 | 26 | >> 4000 | 26 | >>
4000 | 27 | >>= 4000 | 27 | >>=
4000 | 28 | ^@ 4000 | 28 | ^@
4000 | 29 | <^
4000 | 30 | >^
(123 rows) (123 rows)
-- Check that all opclass search operators have selectivity estimators. -- Check that all opclass search operators have selectivity estimators.
......
...@@ -69,14 +69,14 @@ SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1; ...@@ -69,14 +69,14 @@ SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1;
(3 rows) (3 rows)
-- above -- above
SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >^ p.f1; SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' |>> p.f1;
one | f1 one | f1
-----+---------- -----+----------
| (-5,-12) | (-5,-12)
(1 row) (1 row)
-- below -- below
SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <<| '(0.0, 0.0)';
one | f1 one | f1
-----+---------- -----+----------
| (-5,-12) | (-5,-12)
...@@ -412,7 +412,7 @@ SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS dis ...@@ -412,7 +412,7 @@ SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS dis
-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10 -- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10
SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance
FROM POINT_TBL p1, POINT_TBL p2 FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 >^ p2.f1 WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 |>> p2.f1
ORDER BY distance; ORDER BY distance;
three | point1 | point2 | distance three | point1 | point2 | distance
-------+-------------------+-------------------+------------------ -------+-------------------+-------------------+------------------
......
...@@ -136,9 +136,9 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; ...@@ -136,9 +136,9 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)';
...@@ -220,12 +220,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; ...@@ -220,12 +220,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)';
......
...@@ -46,9 +46,9 @@ SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; ...@@ -46,9 +46,9 @@ SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
...@@ -126,12 +126,12 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -126,12 +126,12 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
...@@ -184,12 +184,12 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -184,12 +184,12 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
...@@ -320,12 +320,12 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -320,12 +320,12 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
...@@ -348,12 +348,12 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; ...@@ -348,12 +348,12 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
......
...@@ -48,10 +48,10 @@ SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 << '(0.0, 0.0)'; ...@@ -48,10 +48,10 @@ SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 << '(0.0, 0.0)';
SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1; SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1;
-- above -- above
SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >^ p.f1; SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' |>> p.f1;
-- below -- below
SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <<| '(0.0, 0.0)';
-- equal -- equal
SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)'; SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)';
...@@ -93,7 +93,7 @@ SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS dis ...@@ -93,7 +93,7 @@ SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS dis
-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10 -- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10
SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance
FROM POINT_TBL p1, POINT_TBL p2 FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 >^ p2.f1 WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 |>> p2.f1
ORDER BY distance; ORDER BY distance;
-- Test that GiST indexes provide same behavior as sequential scan -- Test that GiST indexes provide same behavior as sequential scan
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment