Opened 4 years ago

Closed 4 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: trunk
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 Changed 4 years ago by strk

Resolution: fixed
Status: newclosed

r13864, thanks !

comment:2 Changed 4 years ago by robe

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 Changed 4 years ago by strk

Resolution: fixed
Status: closedreopened

This change might have broken interruption test, see #3226

comment:4 Changed 4 years ago by strk

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 Changed 4 years ago by strk

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.