/**************************************************//**
@file include/buf0rea.h
The database buffer read
Created 11/5/1995 Heikki Tuuri
*******************************************************/
#pragma once
#include"buf0buf.h"
/** Read a page synchronously from a file. buf_page_t::read_complete() willbeinvokedonreadcompletion. @parampage_idpageidentifier @paramchainbuf_pool.page_hashcellforpage_id @paramerrerrorcode:DB_SUCCESSifthepagewassuccessfullyread, DB_SUCCESS_LOCKED_RECifthepagewasnotread, DB_PAGE_CORRUPTEDonpagechecksummismatch, DB_DECRYPTION_FAILEDifpagepostencryptionchecksummatchesbut afterdecryptionnormalpagechecksumdoesnotmatch, DB_TABLESPACE_DELETEDiftablespace.ibdfileismissing @paramunzipwhethertodecompressROW_FORMAT=COMPRESSEDpages @returnbuffer-fixedblock(*errmaybesettoDB_SUCCESS_LOCKED_REC)
@retval nullptr if the page is not available (*err will be set) */
buf_block_t *buf_read_page(const page_id_t page_id, dberr_t *err,
buf_pool_t::hash_chain &chain, bool unzip= true)
noexcept;
/** Read a page asynchronously into buf_pool if it is not already there. @parampage_idpageidentifier @paramspacetablespace
@param trx transaction */ void buf_read_page_background(const page_id_t page_id, fil_space_t *space,
trx_t *trx) noexcept
MY_ATTRIBUTE((nonnull(2)));
/** Applies a random read-ahead in buf_pool if there are at least a threshold valueofaccessedpagesfromtherandomread-aheadarea.Doesnotreadany page,noteventheoneattheposition(space,offset),iftheread-ahead mechanismisnotactivated.NOTE:thecallingthreadmayownlatcheson pages:toavoiddeadlocksthisfunctionmustbewrittensuchthatitcannot endupwaitingfortheselatches! @param[in]page_idpageidofapagewhichthecurrentthread wantstoaccess
@return number of page read requests issued */
ulint buf_read_ahead_random(const page_id_t page_id) noexcept;
/** Applies linear read-ahead if in the buf_pool the page is a border page of alinearread-aheadareaandallthepagesintheareahavebeenaccessed. Doesnotreadanypageiftheread-aheadmechanismisnotactivated.Note thatthealgorithmlooksatthe'natural'adjacentsuccessorand predecessorofthepage,whichontheleaflevelofaB-treearethenext andpreviouspageinthechainofleaves.Toknowthese,thepagespecified in(space,offset)mustalreadybepresentinthebuf_pool.Thus,the naturalwaytousethisfunctionistocallitwhenapageinthebuf_pool isaccessedthefirsttime,callingthisfunctionjustafterithasbeen bufferfixed. NOTE1:asthisfunctionlooksatthenaturalpredecessorandsuccessor fieldsonthepage,whathappens,ifthesearenotinitializedtoany sensiblevalue?Noproblem,beforeapplyingread-aheadwecheckthatthe areatoreadiswithinthespanofthespace,ifnot,read-aheadisnot applied.Anuninitializedvaluemayresultinauselessreadoperation,but onlyveryimprobably. NOTE2:thecallingthreadmayownlatchesonpages:toavoiddeadlocksthis functionmustbewrittensuchthatitcannotendupwaitingforthese latches! @param[in]page_idpageid;seeNOTE3above
@return number of page read requests issued */
ulint buf_read_ahead_linear(const page_id_t page_id) noexcept;
/** Schedule a page for recovery. @paramspacetablespace @parampage_idpageidentifier @paramrecslogrecords
@param init_lsn page initialization, or 0 if the page needs to be read */ void buf_read_recover(fil_space_t *space, const page_id_t page_id,
page_recv_t &recs, lsn_t init_lsn) noexcept;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 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.