Commit 09e7020
committed
ORCA: allow partition table use the append node
In ORCA, both Dynamic Scan and Append operators can serve as scan methods
for partitioned tables.
Historically, ORCA initially supported the Append operator before switching
to Dynamic Any Scan, with several iterations of changes in between.
In current CBDB versions, Dynamic Scan is the default partitioned table scan
operator. However, the vectorized executor in CBDB (closed-source) cannot
support Dynamic Scan due to its multi-threaded architecture, which prohibits
metadata reading during scanning.
This commit reintroduces the Append operator as an alternative. The GUC
`optimizer_disable_dynamic_table_scan` (default: off) now allows choosing
between Dynamic Scan and Append operators.
Important considerations when using Append operator:
1. **Row-level security unsupported on root partition table**: Append cannot
be used with row-level security on partitioned tables. ORCA applies row-level
security at the final stage, making it impossible to determine the root partition
after generating Append plans. Dynamic Scan preserves root partition information,
enabling runtime application of row-level security to child partitions.
2. **No index-only scan support**: This is a CBDB executor limitation. Only
Dynamic Scan supports index-only scans for partitioned tables.1 parent 5804930 commit 09e7020
32 files changed
Lines changed: 23101 additions & 48 deletions
File tree
- src
- backend
- gpopt
- config
- translate
- gporca
- libgpopt
- include/gpopt
- operators
- translate
- src
- operators
- translate
- xforms
- libnaucrates
- include/naucrates
- dxl
- operators
- xml
- traceflags
- src
- operators
- parser
- xml
- utils/misc
- include/utils
- test/regress
- expected
- sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
| 304 | + | |
306 | 305 | | |
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3921 | 3921 | | |
3922 | 3922 | | |
3923 | 3923 | | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
3924 | 3949 | | |
3925 | 3950 | | |
3926 | 3951 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3044 | 3044 | | |
3045 | 3045 | | |
3046 | 3046 | | |
3047 | | - | |
| 3047 | + | |
3048 | 3048 | | |
3049 | 3049 | | |
3050 | 3050 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 73 | | |
79 | 74 | | |
80 | 75 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
316 | 336 | | |
317 | 337 | | |
318 | 338 | | |
| |||
562 | 582 | | |
563 | 583 | | |
564 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
565 | 595 | | |
566 | 596 | | |
567 | 597 | | |
| |||
Lines changed: 23 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | 239 | | |
249 | 240 | | |
250 | 241 | | |
| |||
253 | 244 | | |
254 | 245 | | |
255 | 246 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 247 | + | |
| 248 | + | |
260 | 249 | | |
261 | | - | |
262 | | - | |
| 250 | + | |
263 | 251 | | |
264 | | - | |
| 252 | + | |
| 253 | + | |
265 | 254 | | |
266 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
267 | 272 | | |
268 | 273 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 274 | + | |
276 | 275 | | |
277 | | - | |
278 | 276 | | |
279 | 277 | | |
280 | 278 | | |
| |||
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
286 | | - | |
287 | 284 | | |
288 | 285 | | |
0 commit comments