forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd1740e1
committed
Fix calculation in brin_minmax_multi_distance_date
When calculating the distance between date values, make sure to subtractthem in the right order, i.e. (larger - smaller).The distance is used to determine which values to merge, and is expectedto be a positive value. The code unfortunately did the subtraction inthe opposite order, i.e. (smaller - larger), thus producing negativevalues and merging values the most distant values first.The resulting index is correct (i.e. produces correct results), but maybe significantly less efficient. This affects all minmax-multi indexeson date columns.Backpatch to 14, where minmax-multi indexes were introduced.Reported-by: Ashutosh BapatReviewed-by: Ashutosh Bapat, Dean RasheedBackpatch-through: 14Discussion:https://postgr.es/m/eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com1 parent90c4da6 commitd1740e1
File tree
3 files changed
+44
-1
lines changed- src
- backend/access/brin
- test/regress
- expected
- sql
3 files changed
+44
-1
lines changedLines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2075 | 2075 |
| |
2076 | 2076 |
| |
2077 | 2077 |
| |
| 2078 | + | |
2078 | 2079 |
| |
2079 | 2080 |
| |
2080 | 2081 |
| |
2081 | 2082 |
| |
2082 | 2083 |
| |
2083 | 2084 |
| |
2084 |
| - | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
2085 | 2090 |
| |
2086 | 2091 |
| |
2087 | 2092 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
479 | 479 |
| |
480 | 480 |
| |
481 | 481 |
| |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
482 | 502 |
| |
483 | 503 |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
440 | 440 |
| |
441 | 441 |
| |
442 | 442 |
| |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
443 | 461 |
| |
444 | 462 |
|
0 commit comments
Comments
(0)