- Notifications
You must be signed in to change notification settings - Fork5
Commit3c29b19
committed
Fix gist_box_same and gist_point_consistent to handle fuzziness correctly.
While there's considerable doubt that we want fuzzy behavior in thegeometric operators at all (let alone as currently implemented), nobody isstepping forward to redesign that stuff. In the meantime it behooves usto make sure that index searches agree with the behavior of the underlyingoperators. This patch fixes two problems in this area.First, gist_box_same was using fuzzy equality, but it really needs to useexact equality to prevent not-quite-identical upper index keys from beingtreated as identical, which for example would prevent an existing upperkey from being extended by an amount less than epsilon. This would resultin inconsistent indexes. (The next release notes will need to recommendthat users reindex GiST indexes on boxes, polygons, circles, and points,since all four opclasses use gist_box_same.)Second, gist_point_consistent used exact comparisons for upper-pagecomparisons in ~= searches, when it needs to use fuzzy comparisons toensure it finds all matches; and it used fuzzy comparisons for point <@ boxsearches, when it needs to use exact comparisons because that's what the<@ operator (rather inconsistently) does.The added regression test cases illustrate all three misbehaviors.Back-patch to all active branches. (8.4 did not have GiST point_ops,but it still seems prudent to apply the gist_box_same patch to it.)Alexander Korotkov, reviewed by Noah Misch1 parent381d4b7 commit3c29b19
File tree
3 files changed
+112
-15
lines changed- src
- backend/access/gist
- test/regress
- expected
- sql
3 files changed
+112
-15
lines changedLines changed: 41 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
838 | 838 |
| |
839 | 839 |
| |
840 | 840 |
| |
841 |
| - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
842 | 847 |
| |
843 | 848 |
| |
844 | 849 |
| |
| |||
848 | 853 |
| |
849 | 854 |
| |
850 | 855 |
| |
851 |
| - | |
852 |
| - | |
853 |
| - | |
| 856 | + | |
| 857 | + | |
854 | 858 |
| |
855 |
| - | |
| 859 | + | |
856 | 860 |
| |
857 | 861 |
| |
858 | 862 |
| |
| |||
1296 | 1300 |
| |
1297 | 1301 |
| |
1298 | 1302 |
| |
1299 |
| - | |
1300 |
| - | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1301 | 1306 |
| |
1302 | 1307 |
| |
1303 | 1308 |
| |
1304 |
| - | |
1305 |
| - | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1306 | 1313 |
| |
1307 | 1314 |
| |
1308 | 1315 |
| |
| |||
1337 | 1344 |
| |
1338 | 1345 |
| |
1339 | 1346 |
| |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
1344 |
| - | |
1345 |
| - | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1346 | 1372 |
| |
1347 | 1373 |
| |
1348 | 1374 |
| |
|
Lines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + |
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + |
0 commit comments
Comments
(0)