Opened 9 years ago

Closed 9 years ago

#3223 closed enhancement (fixed)

Add memcmp short-circuit to ST_Equals

Reported by: dbaston Owned by: strk
Priority: medium Milestone: PostGIS 2.2.0
Component: postgis Version: master
Keywords: Cc:

Description

As described in pull request 44 (https://github.com/postgis/postgis/pull/44), this can be very beneficial for certain types of queries.

Patch at https://patch-diff.githubusercontent.com/raw/postgis/postgis/pull/44.patch

Change History (5)

comment:1 by strk, 9 years ago

Resolution: fixed
Status: newclosed

r13864, thanks !

comment:2 by robe, 9 years ago

Not a huge deal, but wouldn't this cause a regression for invalid geometries? I think before even if they were mem equal, they were invalid because of not well-defined space.

comment:3 by strk, 9 years ago

Resolution: fixed
Status: closedreopened

This change might have broken interruption test, see #3226

comment:4 by strk, 9 years ago

robe2 about regression on invalid geometries, what would you expect from ST_Equals in that case ? A false, a null or an exception ? None of the relate operations are _guaranteed_ to return a specific value on invalid input, as it would require checking for validity and it's expensive.

comment:5 by strk, 9 years ago

Resolution: fixed
Status: reopenedclosed

Closing, after confirming that the interrupt tests only failed because the ST_Equals call performed by the test is now faster than the timeout. Case fixed by changing the testcase to make not as easy to compute equals :)

Note: See TracTickets for help on using tickets.