pgsql: Simplify box_overlap computations.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Simplify box_overlap computations.
Date: 2013-02-08 23:26:16
Message-ID: E1U3xKi-00083p-O0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify box_overlap computations.

Given the assumption that a box's high coordinates are not less than its
low coordinates, the tests in box_ov() are overly complicated and can be
reduced to about half as much work. Since many other functions in
geo_ops.c rely on that assumption, there doesn't seem to be a good reason
not to use it here.

Per discussion of Alexander Korotkov's GiST fix, which was already using
the simplified logic (in a non-fuzzy form, but the equivalence holds just
as well for fuzzy).

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/geo_ops.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-02-09 04:58:57 pgsql: Add support for ALTER RULE ... RENAME TO.
Previous Message Tom Lane 2013-02-08 23:04:07 pgsql: Fix gist_box_same and gist_point_consistent to handle fuzziness