forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit394d517
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 parentb5489b7 commit394d517
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 | |
---|---|---|---|
| |||
2081 | 2081 |
| |
2082 | 2082 |
| |
2083 | 2083 |
| |
| 2084 | + | |
2084 | 2085 |
| |
2085 | 2086 |
| |
2086 | 2087 |
| |
2087 | 2088 |
| |
2088 | 2089 |
| |
2089 | 2090 |
| |
2090 |
| - | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
2091 | 2096 |
| |
2092 | 2097 |
| |
2093 | 2098 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
836 | 836 |
| |
837 | 837 |
| |
838 | 838 |
| |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
839 | 859 |
| |
840 | 860 |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
605 | 605 |
| |
606 | 606 |
| |
607 | 607 |
| |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
608 | 626 |
| |
609 | 627 |
|
0 commit comments
Comments
(0)