- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitedd4473
committed
Be lazier about partition tuple routing.
It's not necessary to fully initialize the executor data structuresfor partitions to which no tuples are ever routed. Consider, forexample, an INSERT statement that inserts only one row: it only caresabout the partition to which that one row is routed. The new functionExecInitPartitionInfo performs the initialization in question onlywhen a particular partition is about to receive a tuple. This includescreating, validating, and saving a pointer to the ResultRelInfo,setting up for speculative insertions, translating WCOs andinitializing the resulting expressions, translating returning listsand building the appropriate projection information, and setting up atuple conversion map.One thing that's not deferred is locking the child partitions; thatseems desirable but would need more thought. Still, testing showsthat this makes single-row inserts significantly faster on a tablewith many partitions without harming the bulk-insert case.Amit Langote, reviewed by Etsuro Fujita, with a few changes by meDiscussion:http://postgr.es/m/8975331d-d961-cbdd-f862-fdd3d97dc2d0@lab.ntt.co.jp1 parent810e7e2 commitedd4473
File tree
4 files changed
+279
-232
lines changed- src
- backend
- commands
- executor
- include/executor
4 files changed
+279
-232
lines changedLines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2469 | 2469 |
| |
2470 | 2470 |
| |
2471 | 2471 |
| |
2472 |
| - | |
| 2472 | + | |
2473 | 2473 |
| |
2474 | 2474 |
| |
2475 | 2475 |
| |
| |||
2606 | 2606 |
| |
2607 | 2607 |
| |
2608 | 2608 |
| |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
2609 | 2617 |
| |
2610 | 2618 |
| |
2611 | 2619 |
| |
|
0 commit comments
Comments
(0)