- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit3f26be8
committed
Fix IOS planning when only some index columns can return an attribute.
Since 9.5, it's possible that some but not all columns of an indexsupport returning the indexed value for index-only scans. If thesame indexed column appears in index columns that behave both ways,check_index_only() supposed that it'd be OK to do an index-only scantesting that column; but that fails if we have to recheck the indexedcondition on one of the columns that doesn't support this.In principle we could make this work by remapping the recheck expressionsto pull the value from a column that does support returning the indexedvalue. But such cases are so weird and rare that, at least for now,it doesn't seem worth the trouble. Instead, just teach check_index_onlythat a value is returnable only if all the index columns containing itare returnable, rather than any of them.Per report from David Pereiro Lagares. Back-patch to 9.5 where thepossibility of this situation appeared.Kyotaro HoriguchiDiscussion:https://postgr.es/m/1516210494.1798.16.camel@nlpgo.com1 parent11e7700 commit3f26be8
File tree
3 files changed
+71
-1
lines changed- contrib/btree_gist
- expected
- sql
- src/backend/optimizer/path
3 files changed
+71
-1
lines changedLines changed: 39 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + |
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + |
Lines changed: 14 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1791 | 1791 |
| |
1792 | 1792 |
| |
1793 | 1793 |
| |
| 1794 | + | |
1794 | 1795 |
| |
1795 | 1796 |
| |
1796 | 1797 |
| |
| |||
1830 | 1831 |
| |
1831 | 1832 |
| |
1832 | 1833 |
| |
1833 |
| - | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1834 | 1839 |
| |
1835 | 1840 |
| |
1836 | 1841 |
| |
| |||
1847 | 1852 |
| |
1848 | 1853 |
| |
1849 | 1854 |
| |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1850 | 1859 |
| |
1851 | 1860 |
| |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1852 | 1864 |
| |
1853 | 1865 |
| |
1854 | 1866 |
| |
1855 | 1867 |
| |
1856 | 1868 |
| |
| 1869 | + | |
1857 | 1870 |
| |
1858 | 1871 |
| |
1859 | 1872 |
| |
|
0 commit comments
Comments
(0)