[MDEV-25921] Implement CREATE TABLE...SELECT in one transaction Created: 2021-06-15  Updated: 2024-02-07

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Create Table, Partitioning, Storage Engine - InnoDB
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Marko Mäkelä Assignee: Michael Widenius
Resolution: Unresolved Votes: 2
Labels: performance

Issue Links:
Blocks
blocks MDEV-4259 transactional DDL Open
blocks MDEV-11655 Transactional data dictionary Open
is blocked by MDEV-25919 InnoDB reports misleading lock wait t... Closed
PartOf
includes MDEV-25292 Atomic CREATE OR REPLACE TABLE Stalled
Relates
relates to MDEV-21602 CREATE TABLE…PRIMARY KEY…SELECT worka... Closed

 Description   

As hinted in MDEV-21602, CREATE TABLE...SELECT is currently implemented in multiple transactions:

  1. Transaction(s) to create (each partition or subpartition of) the table
  2. Another transaction to execute INSERT...SELECT
  3. If an error occurs: transaction(s) to execute handler::delete_table()

A cleaner solution would be to use a single transaction for the entire operation. If an error occurs, we would simply roll back the operation.



 Comments   
Comment by Marko Mäkelä [ 2021-06-15 ]

MDEV-25919 will facilitate this in InnoDB by allowing the combination of DDL and DML operations in arbitrary transactions.

Generated at Thu Feb 08 09:41:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.