forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8da86d6
committed
Fix minmax-multi on infinite date/timestamp values
Make sure that infinite values in date/timestamp columns are treated asif in infinite distance. Infinite values should not be merged with othervalues, leaving them as outliers. The code however returned distance 0in this case, so that infinite values were merged first. While this doesnot break the index (i.e. it still produces correct query results), itmay make it much less efficient.We don't need explicit handling of infinite date/timestamp values whencalculating distances, because those values are represented as extremebut regular values (e.g. INT64_MIN/MAX for the timestamp type).We don't need an exact distance, just a value that is much larger thandistanced between regular values. With the added cast to double values,we can simply subtract the values.The regression test queries a value in the "gap" and checks the rangewas properly eliminated by the BRIN index.This only affects minmax-multi indexes on timestamp/date columns withinfinite values, which is not very common in practice. The affectedindexes may need to be rebuilt.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 parent394d517 commit8da86d6
File tree
3 files changed
+96
-6
lines changed- src
- backend/access/brin
- test/regress
- expected
- sql
3 files changed
+96
-6
lines changedLines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2085 | 2085 |
| |
2086 | 2086 |
| |
2087 | 2087 |
| |
2088 |
| - | |
2089 |
| - | |
2090 |
| - | |
2091 | 2088 |
| |
2092 | 2089 |
| |
2093 | 2090 |
| |
| |||
2146 | 2143 |
| |
2147 | 2144 |
| |
2148 | 2145 |
| |
2149 |
| - | |
2150 |
| - | |
2151 |
| - | |
2152 | 2146 |
| |
2153 | 2147 |
| |
2154 | 2148 |
| |
|
Lines changed: 57 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
855 | 855 |
| |
856 | 856 |
| |
857 | 857 |
| |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
858 | 915 |
| |
859 | 916 |
| |
860 | 917 |
|
Lines changed: 39 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
622 | 622 |
| |
623 | 623 |
| |
624 | 624 |
| |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
625 | 664 |
| |
626 | 665 |
| |
627 | 666 |
|
0 commit comments
Comments
(0)