summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-08-24 16:12:31 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-08-24 16:12:31 +0530
commited04885fda1fd2f9d75dd6515677f7e8a68b1ebe (patch)
treecb749e6b67daa8e0131bfee03f1fbbea72ce4427 /sql/handler.h
parent9ac1ac006197c8979db1dc73f4e983f623e831e8 (diff)
downloadmariadb-git-bb-10.6-MDEV-24621.tar.gz
MDEV-24621 In bulk insert, pre-sort and build indexesbb-10.6-MDEV-24621
one page at a time If the table is empty then InnoDB should pre-sort the records for each index, and build the indexes one page at a time. If the transaction does bulk insert operation then InnoDB should create buffer of size `innodb_sort_buffer_size` for each index. If the buffer ran out of memory then InnoDB should create a temporary file for storing the data. Once transaction statement gets committed then InnoDB should sort the buffer/file blocks and do bulk insert operation for each index. In case of externally stored field, InnoDB bulk insert operation should store the data in temporary created blob file. Criteria to store the field data in blob file should be more than 2000 bytes. ha_commit_trans(): Apply buffered insert operation at the end of single statment commit operation. innodb_bulk_insert_write(): Apply all bulk buffered insert operation for the given transaction. row_merge_buf_write(): This function should accept blob file handle too and it should write the field data which are greater than 2000 bytes row_merge_bulk_t: Data structure to maintain the data during bulk insert operation. trx_mod_table_time_t::start_bulk_insert(): Notify the start of bulk insert operation and create new buffer for the given table trx_mod_table_time_t::add_tuple(): Add the tuple for the given index buffer trx_mod_table_time_t::write_bulk(): Do bulk insert operation present in the transaction trx_mod_table_time_t::bulk_buffer_exist(): Whether the buffer storage exist for the bulk transaction trx_t::is_bulk_exists(): Return logical modified field of the table trx_t::write_all_bulk(): Write all buffered insert operation for the transaction row_ins_clust_index_entry_low(): Insert the data into the bulk buffer if it is already exist. row_ins_sec_index_entry(): Insert the secondary tuple if the bulk buffer already exist. row_merge_bulk_buf_add(): Insert the tuple into bulk buffer insert operation. row_merge_buf_blob(): Write the field data whose length is more than 2000 bytes into blob temporary file. Write the file offset and length into the tuple field. row_merge_copy_blob_from_file(): Copy the blob from blob file handler based on reference of the given tuple. row_merge_insert_index_tuples(): Handle blob for bulk insert operation. row_merge_bulk_t::row_merge_bulk_t(): Constructor. Initialize the buffer and file for all the indexes expect fts index. row_merge_bulk_t::~row_merge_bulk_t(): Destructor row_merge_bulk_t::create_tmp_file(): Create new temporary file for the given index. row_merge_bulk_t::write_to_tmp_file(): Write the content from buffer to disk file for the given index. row_merge_bulk_t::add_tuple(): Insert the tuple into the merge buffer for the given index. If the memory ran out then InnoDB should sort the buffer and write into file. row_merge_bulk_t::write_to_index(): Do bulk insert operation from merge file/merge buffer for the given index row_merge_bulk_t::write_to_table(): Do bulk insert operation for all the indexes.
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 75a15ed4c6a..a6430b345ed 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1789,6 +1789,12 @@ struct handlerton
int (*create_partitioning_metadata)(const char *path,
const char *old_path,
chf_create_flags action_flag);
+
+ /*
+ This method is used to apply buffered bulk insert operations
+ during single statement commit operation
+ */
+ int (*bulk_insert_write)(THD *thd);
};