diff options
Diffstat (limited to 'storage/innobase/include/btr0bulk.h')
-rw-r--r-- | storage/innobase/include/btr0bulk.h | 65 |
1 files changed, 25 insertions, 40 deletions
diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h index b8428186383..943836f8759 100644 --- a/storage/innobase/include/btr0bulk.h +++ b/storage/innobase/include/btr0bulk.h @@ -35,8 +35,6 @@ Created 03/11/2014 Shaohua Wang /** Innodb B-tree index fill factor for bulk load. */ extern uint innobase_fill_factor; -/** whether to reduce redo logging during ALTER TABLE */ -extern my_bool innodb_log_optimize_ddl; /* The proper function call sequence of PageBulk is as below: @@ -55,14 +53,12 @@ public: @param[in] index B-tree index @param[in] page_no page number @param[in] level page level - @param[in] trx_id transaction id - @param[in] observer flush observer */ + @param[in] trx_id transaction id */ PageBulk( dict_index_t* index, trx_id_t trx_id, - ulint page_no, - ulint level, - FlushObserver* observer) + uint32_t page_no, + ulint level) : m_heap(NULL), m_index(index), @@ -83,7 +79,6 @@ public: m_total_data(0), #endif /* UNIV_DEBUG */ m_modify_clock(0), - m_flush_observer(observer), m_err(DB_SUCCESS) { ut_ad(!dict_index_is_spatial(m_index)); @@ -104,11 +99,24 @@ public: /** Insert a record in the page. @param[in] rec record @param[in] offsets record offsets */ - void insert(const rec_t* rec, rec_offs* offsets); + inline void insert(const rec_t* rec, rec_offs* offsets); +private: + /** Page format */ + enum format { REDUNDANT, DYNAMIC, COMPRESSED }; + /** Mark end of insertion to the page. Scan all records to set page + dirs, and set page header members. + @tparam format the page format */ + template<format> inline void finishPage(); + /** Insert a record in the page. + @tparam format the page format + @param[in,out] rec record + @param[in] offsets record offsets */ + template<format> inline void insertPage(rec_t* rec, rec_offs* offsets); +public: /** Mark end of insertion to the page. Scan all records to set page dirs, and set page header members. */ - void finish(); + inline void finish(); /** @return whether finish() actually needs to do something */ inline bool needs_finish() const; @@ -171,10 +179,7 @@ public: inline bool isSpaceAvailable(ulint rec_size); /** Get page no */ - ulint getPageNo() - { - return(m_page_no); - } + uint32_t getPageNo() const { return m_page_no; } /** Get page level */ ulint getLevel() @@ -205,6 +210,8 @@ public: return(m_err); } + void set_modified() { m_mtr.set_modified(*m_block); } + /* Memory heap for internal allocation */ mem_heap_t* m_heap; @@ -231,7 +238,7 @@ private: rec_t* m_cur_rec; /** The page no */ - ulint m_page_no; + uint32_t m_page_no; /** The page level in B-tree */ ulint m_level; @@ -263,9 +270,6 @@ private: when the block is re-pinned */ ib_uint64_t m_modify_clock; - /** Flush observer, or NULL if redo logging is enabled */ - FlushObserver* m_flush_observer; - /** Operation result DB_SUCCESS or error code */ dberr_t m_err; }; @@ -278,31 +282,15 @@ class BtrBulk public: /** Constructor @param[in] index B-tree index - @param[in] trx transaction - @param[in] observer flush observer */ + @param[in] trx transaction */ BtrBulk( dict_index_t* index, - const trx_t* trx, - FlushObserver* observer) + const trx_t* trx) : m_index(index), - m_trx(trx), - m_flush_observer(observer) + m_trx(trx) { ut_ad(!dict_index_is_spatial(index)); -#ifdef UNIV_DEBUG - if (m_flush_observer) - m_index->table->space->redo_skipped_count++; -#endif /* UNIV_DEBUG */ - } - - /** Destructor */ - ~BtrBulk() - { -#ifdef UNIV_DEBUG - if (m_flush_observer) - m_index->table->space->redo_skipped_count--; -#endif /* UNIV_DEBUG */ } /** Insert a tuple @@ -376,9 +364,6 @@ private: /** Root page level */ ulint m_root_level; - /** Flush observer, or NULL if redo logging is enabled */ - FlushObserver*const m_flush_observer; - /** Page cursor vector for all level */ page_bulk_vector m_page_bulks; }; |