forked from timescale/timescaledb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For tuple routing we set up a ChunkDispatch subplan to the ModifyTable plan that reads the tuples to insert and locates the correct chunk to insert them into and then passes a tuple table slot matching that chunk to ModifyTable. `ExecModifyTable()` expects a tuple table slot with the same number of attributes as the parent table. If an attribute is dropped in the parent table and a chunk is subsequently created, the dropped attribute will be present in the tuple table slot for the parent table but not for the new chunk. As a result, the slot passed back to ModifyTable will have a different number of attributes compared to what is expected and if `ExecCopySlot()` is called, it will assert with a failure because the two slots are expected to have the same number of attributes. Partition tables deal with this by passing back a virtual tuple to `ExecModifyTable()` and then locate the correct partition and corresponding slot in `ExecInsert()` by calling the function `ExecPrepareTupleRouting()` and mapping the attributes between the virtual slot and the actual partition slot. This commit solves this in a similar manner by moving part of the re-mapping done by `chunk_dispatch_exec()` to `ExecInsert()`, similar to how it is done for partition tables, and returning the slot from the subplan, allowing `ExecModifyTable()` to keep the same logic as before.
- Loading branch information
Showing
5 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters