- Notifications
You must be signed in to change notification settings - Fork5
Commitddbe8dc
committed
Add a heuristic to transformAExprIn() to make it prefer expanding "x IN (list)"
into an OR of equality comparisons, rather than x = ANY(ARRAY[...]), when thereare Vars in the right-hand side. This avoids a performance regression comparedto pre-8.2 releases, in cases where the OR form can be optimized into scansof multiple indexes. Limit the possible downside by preferring this form onlywhen the list isn't very long (I set the cutoff at 32 elements, which is abit arbitrary but in the right ballpark). Per discussion with Jim Nasby.In passing, also make it try the OR form if it cannot select a common typefor the array elements; we've seen a complaint or two about how the OR formworked for such cases and ARRAY doesn't.1 parent312b1a9 commitddbe8dc
2 files changed
+35
-15
lines changedLines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1085 | 1085 |
| |
1086 | 1086 |
| |
1087 | 1087 |
| |
1088 |
| - | |
1089 |
| - | |
| 1088 | + | |
| 1089 | + | |
1090 | 1090 |
| |
1091 | 1091 |
| |
1092 | 1092 |
| |
1093 | 1093 |
| |
1094 |
| - | |
| 1094 | + | |
| 1095 | + | |
1095 | 1096 |
| |
1096 | 1097 |
| |
1097 | 1098 |
| |
| |||
1166 | 1167 |
| |
1167 | 1168 |
| |
1168 | 1169 |
| |
| 1170 | + | |
| 1171 | + | |
1169 | 1172 |
| |
1170 | 1173 |
| |
1171 | 1174 |
| |
|
Lines changed: 28 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
974 | 975 |
| |
975 | 976 |
| |
976 | 977 |
| |
977 |
| - | |
978 |
| - | |
979 |
| - | |
980 |
| - | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
981 | 992 |
| |
982 |
| - | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
983 | 997 |
| |
984 | 998 |
| |
985 | 999 |
| |
986 | 1000 |
| |
987 | 1001 |
| |
988 | 1002 |
| |
989 |
| - | |
990 |
| - | |
991 |
| - | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
992 | 1006 |
| |
993 | 1007 |
| |
994 | 1008 |
| |
995 | 1009 |
| |
996 |
| - | |
| 1010 | + | |
997 | 1011 |
| |
998 | 1012 |
| |
999 |
| - | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
1000 | 1017 |
| |
1001 | 1018 |
| |
1002 | 1019 |
| |
|
0 commit comments
Comments
(0)