forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit100340e
committed
Restore foreign-key-aware estimation of join relation sizes.
This patch provides a new implementation of the logic added by commit137805f and later removed by77ba610. It differs from the originalprimarily in expending much less effort per joinrel in large queries,which it accomplishes by doing most of the matching work once per query notonce per joinrel. Hopefully, it's also less buggy and better commented.The never-documented enable_fkey_estimates GUC remains gone.There remains work to be done to make the selectivity estimates accountfor nulls in FK referencing columns; but that was true of the originalpatch as well. We may be able to address this point later in beta.In the meantime, any error should be in the direction of overestimatingrather than underestimating joinrel sizes, which seems like the directionwe want to err in.Tomas Vondra and Tom LaneDiscussion: <31041.1465069446@sss.pgh.pa.us>1 parent598aa19 commit100340e
File tree
17 files changed
+921
-18
lines changed- src
- backend
- nodes
- optimizer
- path
- plan
- util
- utils/cache
- include
- nodes
- optimizer
- utils
17 files changed
+921
-18
lines changedLines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
| |||
4254 | 4255 |
| |
4255 | 4256 |
| |
4256 | 4257 |
| |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
| 4269 | + | |
| 4270 | + | |
| 4271 | + | |
| 4272 | + | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
4257 | 4276 |
| |
4258 | 4277 |
| |
4259 | 4278 |
| |
| |||
5052 | 5071 |
| |
5053 | 5072 |
| |
5054 | 5073 |
| |
| 5074 | + | |
| 5075 | + | |
| 5076 | + | |
| 5077 | + | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
5055 | 5081 |
| |
5056 | 5082 |
| |
5057 | 5083 |
| |
|
Lines changed: 60 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
| |||
2050 | 2051 |
| |
2051 | 2052 |
| |
2052 | 2053 |
| |
| 2054 | + | |
2053 | 2055 |
| |
2054 | 2056 |
| |
2055 | 2057 |
| |
| |||
2139 | 2141 |
| |
2140 | 2142 |
| |
2141 | 2143 |
| |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
2142 | 2175 |
| |
2143 | 2176 |
| |
2144 | 2177 |
| |
| |||
3209 | 3242 |
| |
3210 | 3243 |
| |
3211 | 3244 |
| |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
3212 | 3266 |
| |
3213 | 3267 |
| |
3214 | 3268 |
| |
| |||
3609 | 3663 |
| |
3610 | 3664 |
| |
3611 | 3665 |
| |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
3612 | 3669 |
| |
3613 | 3670 |
| |
3614 | 3671 |
| |
| |||
3785 | 3842 |
| |
3786 | 3843 |
| |
3787 | 3844 |
| |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
3788 | 3848 |
| |
3789 | 3849 |
| |
3790 | 3850 |
| |
|
0 commit comments
Comments
(0)