/** Initialize members and allocate page if needed and start mtr. Note:mustbecalledandonlyoncerightafterconstructor.
@return error code */
dberr_t init();
/** Insert a record in the page. @param[in]recrecord
@param[in] offsets record offsets */ inlinevoid 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,andsetpageheadermembers.
@tparam format the page format */ template<format> inlinevoid finishPage(); /** Insert a record in the page. @tparamformatthepageformat @param[in,out]recrecord
@param[in] offsets record offsets */ template<format> inlinevoid 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. */ inlinevoid finish();
/** @return whether finish() actually needs to do something */ inlinebool needs_finish() const;
/** Commit mtr for a page
@param[in] success Flag whether all inserts succeed. */ void commit(bool success);
/** Compress if it is compressed table @returntruecompresssuccessfullyornoneedtocompress
@return false compress failed. */ bool compress();
/** Check whether the record needs to be stored externally. @returntrue
@return false */ bool needExt(const dtuple_t* tuple, ulint rec_size);
/** Store external record @param[in]big_recexternalrecrod @param[in]offsetsrecordoffsets
@return error code */
dberr_t storeExt(const big_rec_t* big_rec, rec_offs* offsets);
/** Get node pointer
@return node pointer */
dtuple_t* getNodePtr();
/** Get split rec in the page. We split a page in half when compresssion fails,andthesplitrecshouldbecopiedtothenewpage.
@return split rec */
rec_t* getSplitRec();
/** Copy all records after split rec including itself.
@param[in] rec split rec */ void copyIn(rec_t* split_rec);
/** Remove all records after split rec including itself.
@param[in] rec split rec */ void copyOut(rec_t* split_rec);
/** Set next page
@param[in] next_page_no next page no */ inlinevoid setNext(ulint next_page_no);
/** Set previous page
@param[in] prev_page_no previous page no */ inlinevoid setPrev(ulint prev_page_no);
/** Release block by commiting mtr */ inlinevoid release();
/** Start mtr and latch block */ inlinevoid latch();
/** Check if required space is available in the page for the rec tobeinserted.Wecheckfillfactor&paddinghere. @param[in]lengthrequiredlength
@return true if space is available */ inlinebool isSpaceAvailable(ulint rec_size);
/** Get page no */
uint32_t getPageNo() const { return m_page_no; }
/** Get page level */
ulint getLevel()
{ return(m_level);
}
/** Get record no */
ulint getRecNo()
{ return(m_rec_no);
}
/** Get page */
page_t* getPage()
{ return(m_page);
}
/** Get page zip */
page_zip_des_t* getPageZip()
{ return(m_page_zip);
}
/** Btree bulk load finish. We commit the last page in each level andcopythelastpageintopleveltotherootpageoftheindex ifnoerroroccurs. @param[in]errwhetherbulkloadwassuccessfuluntilnow
@return error code */
dberr_t finish(dberr_t err);
private: /** Insert a tuple to a page in a level @param[in]tupletupletoinsert @param[in]levelB-treelevel
@return error code */
dberr_t insert(dtuple_t* tuple, ulint level);
/** Commit(finish) a page. We set next/prev page no, compress a page of compressedtableandsplitthepageifcompressionfails,insertanode pointertofatherpageifneeded,andcommitmini-transaction. @param[in]page_bulkpagetocommit @param[in]next_page_bulknextpage @param[in]insert_fatherflagwhetherneedtoinsertnodeptr
@return error code */
dberr_t pageCommit(PageBulk* page_bulk,
PageBulk* next_page_bulk, bool insert_father);
/** Abort a page when an error occurs @param[in]page_bulkpagebulkobject Note:weshouldcallpageAbortforaPageBulkobject,whichisnotin m_page_bulksafterpageCommit,andwewillcommitorabortPageBulk
objects in function "finish". */ void pageAbort(PageBulk* page_bulk)
{
page_bulk->commit(false);
}
/** Log free check */ inlinevoid logFreeCheck();
private: /** B-tree index */
dict_index_t*const m_index;
/** Transaction */
trx_t*const m_trx;
/** Root page level */
ulint m_root_level;
/** Page cursor vector for all level */
page_bulk_vector m_page_bulks;
};
#endif
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.