diff options
author | Eugene Kosov <claprix@yandex.ru> | 2020-03-19 18:33:19 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2020-03-20 21:35:42 +0300 |
commit | 45973ec61058b1428ae88316631f49e58d227207 (patch) | |
tree | c670af6c82bb2be9a85ea6cacd7753d02d40b4fd /storage/innobase/include | |
parent | 54b2da9535614f3115723bb026b6ef56064f0c82 (diff) | |
download | mariadb-git-45973ec61058b1428ae88316631f49e58d227207.tar.gz |
InnoDB: reduce size of dtuple_t
Making a linked list of dtuple_t is needed only for inserting
records. It's better to store tuples in a non-intrusive
container to not affect all other use cases of dtuple_t
dtuple_t::tuple_list: removed, it was 2 * sizeof(void*) bytes
ins_node_t::entry_list: now it's std::vector<dtuple_t*>
ins_node_t::entry: now it's std::vector<dtuple_t*>::iterator
DBUG_EXECUTE_IF("row_ins_skip_sec": this dead code removed
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/data0data.h | 6 | ||||
-rw-r--r-- | storage/innobase/include/row0ins.h | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/storage/innobase/include/data0data.h b/storage/innobase/include/data0data.h index 33d03c8a2c9..fdf1a14feee 100644 --- a/storage/innobase/include/data0data.h +++ b/storage/innobase/include/data0data.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2019, 2020 MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -32,6 +32,7 @@ Created 5/30/1994 Heikki Tuuri #include "mem0mem.h" #include "dict0types.h" #include "btr0types.h" +#include <vector> #include <ostream> @@ -510,9 +511,6 @@ struct dtuple_t { dfield_t* fields; /*!< fields */ ulint n_v_fields; /*!< number of virtual fields */ dfield_t* v_fields; /*!< fields on virtual column */ - UT_LIST_NODE_T(dtuple_t) tuple_list; - /*!< data tuples can be linked into a - list using this field */ #ifdef UNIV_DEBUG ulint magic_n; /*!< magic number, used in debug assertions */ diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h index 164f6fe1ddb..27fe442f6ff 100644 --- a/storage/innobase/include/row0ins.h +++ b/storage/innobase/include/row0ins.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2019, 2020 MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -31,6 +31,7 @@ Created 4/20/1996 Heikki Tuuri #include "que0types.h" #include "trx0types.h" #include "row0types.h" +#include <vector> /***************************************************************//** Checks if foreign key constraint fails for an index entry. Sets shared locks @@ -159,7 +160,10 @@ row_ins_step( /* Insert node structure */ struct ins_node_t{ - que_common_t common; /*!< node type: QUE_NODE_INSERT */ + ins_node_t() : common(QUE_NODE_INSERT, NULL), entry(entry_list.end()) + { + } + que_common_t common; /*!< node type: QUE_NODE_INSERT */ ulint ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */ dtuple_t* row; /*!< row to insert */ dict_table_t* table; /*!< table where to insert */ @@ -169,11 +173,12 @@ struct ins_node_t{ ulint state; /*!< node execution state */ dict_index_t* index; /*!< NULL, or the next index where the index entry should be inserted */ - dtuple_t* entry; /*!< NULL, or entry to insert in the index; + std::vector<dtuple_t*> + entry_list;/* list of entries, one for each index */ + std::vector<dtuple_t*>::iterator + entry; /*!< NULL, or entry to insert in the index; after a successful insert of the entry, this should be reset to NULL */ - UT_LIST_BASE_NODE_T(dtuple_t) - entry_list;/* list of entries, one for each index */ /** buffer for the system columns */ byte sys_buf[DATA_ROW_ID_LEN + DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN]; |