forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit59132bf
Estimate joins using extended statistics
Use extended statistics (MCV) to improve join estimates. In general thisis similar to how we use regular statistics - we search for extendedstatistics (with MCV) covering all join clauses, and if we find such MCVon both sides of the join, we combine those two MCVs.Extended statistics allow a couple additional improvements - e.g. ifthere are baserel conditions, we can use them to restrict the part ofthe MCVs combined. This means we're building conditional probabilitydistribution and calculating conditional probability P(join clauses | baserel conditions)instead of just P(join clauses).The patch also allows combining regular and extended MCV - we don't needextended MCVs on both sides. This helps when one of the tables does nothave extended statistics (e.g. because there are no correlations).1 parentd206c01 commit59132bf
File tree
7 files changed
+1890
-1
lines changed- src
- backend
- optimizer/path
- statistics
- include/statistics
- test/regress
- expected
- sql
7 files changed
+1890
-1
lines changedLines changed: 62 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 |
| |
52 | 55 |
| |
53 | 56 |
| |
| |||
127 | 130 |
| |
128 | 131 |
| |
129 | 132 |
| |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
130 | 170 |
| |
131 | 171 |
| |
132 | 172 |
| |
| |||
136 | 176 |
| |
137 | 177 |
| |
138 | 178 |
| |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
139 | 183 |
| |
140 |
| - | |
| 184 | + | |
141 | 185 |
| |
142 | 186 |
| |
143 | 187 |
| |
| |||
160 | 204 |
| |
161 | 205 |
| |
162 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
163 | 224 |
| |
164 | 225 |
| |
165 | 226 |
| |
|
0 commit comments
Comments
(0)