Lines Matching defs:btree

14867 ** Defer sourcing vdbe.h and btree.h until after the "u8" and
14930 ** NOTE: These values must match the corresponding BTREE_ values in btree.h.
15118 /************** Include btree.h in the middle of sqliteInt.h *****************/
15119 /************** Begin file btree.h *******************************************/
15387 ** entry in either an index or table btree.
15529 /************** End of btree.h ***********************************************/
17152 #define SQLITE_CellSizeCk 0x00200000 /* Check btree cell sizes on load */
17887 ** or greater than a key in the btree, respectively. These are normally
21103 Pgno pgnoRoot; /* Root page of the open btree cursor */
49336 ** btree layer only operates on the cached copy of the database pages.
50229 ** is the extension added by the btree.c module containing information such
50255 ** The btree.c module deals with pointers to MemPage objects.
52701 ** 28 of the database header by the btree). If the size of the file
55977 /* This routine is only called by btree immediately after creating
56784 ** (The extra space is used by btree as the MemPage object.)
57160 /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */
57836 ** The btree layer always holds page1 open until the end, so these first
63925 ** This code really belongs in btree.c. But btree.c is getting too
63980 ** Each page can be either a btree page, a freelist page, an overflow
63983 ** The first page is always a btree page. The first 100 bytes of the first
64036 ** Each btree pages is divided into three sections: The header, the
64066 ** The flags define the format of this btree page. The leaf flag means that
64117 ** bytes of key and data in a btree cell.
64240 ** a btree handle is closed.
64275 sqlite3 *db; /* The database connection holding this btree */
64276 BtShared *pBt; /* Sharable content of this btree */
64282 int nBackup; /* Number of backup operations reading this btree */
64384 BtLock *pLock; /* List of locks held on this shared-btree struct */
64490 #define BTCF_Multiple 0x20 /* Maybe another cursor on the same btree */
64581 ** PTRMAP_BTREE: The database page is a non-root btree page. The page number
64582 ** identifies the parent page in the btree.
64650 ** cell addresses in a btree header.
64801 ** Return true if the BtShared mutex is held on the btree, or if the
64915 ** are null #defines in btree.h.
64917 ** If shared cache is disabled, then all btree mutex routines, including
64918 ** the ones below, are no-ops and are null #defines in btree.h.
64956 /************** Begin file btree.c *******************************************/
64996 ** from the header of a btree page. If the page size is 65536 and the page
65300 ** Add a lock on the table with root-page iTable to the shared-btree used
65458 ** statements only and for the purpose of double-checking that the btree code
65469 ** on the shared btree structure pBt.
65475 ** on the shared btree structure pBt.
65629 /* Only the rowid is required for a table btree */
65632 /* For an index btree, save the complete key content. It is possible
65696 ** the location in the btree is remembered in such a way that it can be
65697 ** moved back to the same spot after the btree has been modified. This
65701 ** If there are two or more cursors on the same btree, then all such
65769 BtCursor *pCur, /* Cursor open on the btree to be searched */
65770 const void *pKey, /* Packed key if the btree is an index */
65841 ** from under them, for example. Cursor might also move if a btree
65870 ** has been moved by some outside activity (such as a btree rebalance or
65980 ** as a btree page. */
66050 ** Given a btree page and a cell index (0 means the first cell on
66103 ** Given a record with nPayload bytes of payload stored within btree
66126 ** btreeParseCellPtr() => table btree leaf nodes
66127 ** btreeParseCellNoPayload() => table btree internal nodes
66128 ** btreeParseCellPtrIndex() => index btree nodes
66269 ** data area of the btree-page. The return number includes the cell
66978 BtShared *pBt; /* The main btree structure */
67064 ** the btree layer.
67091 BtShared *pBt, /* The btree */
67239 BtShared *pBt, /* The btree */
67275 /* pPage might not be a btree page; it might be an overflow page
67279 ** btreeInitPage() be called on every btree page so we make
67287 ** Invoke the busy handler for a btree.
67325 BtShared *pBt = 0; /* Shared part of btree structure */
67449 ** The following asserts make sure that structures used by the btree are
67721 /* If there are still other outstanding references to the shared-btree
67723 ** up the shared-btree.
67814 Btree *p, /* The btree to set the safety level on */
68371 /* If the btree is already in a write-transaction, or it
68396 ** on this shared-btree structure and a second write transaction is
68579 ** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child
68582 ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
68677 /* If pDbPage was a btree-page, then it may have child pages and/or cells
68975 ** Otherwise, sync the database file for the btree pBt. zSuperJrnl points to
69029 ** transaction count of the shared btree. If the transaction count
69363 Btree *p, /* The btree */
69414 /* If there are two or more cursors on the same btree, then all such
69428 Btree *p, /* The btree */
69441 Btree *p, /* The btree */
69568 ** Return the value of the integer key or "rowid" for a table btree.
69570 ** ordinary table btree. If the cursor points to an index btree or
69815 /* Check if data must be read/written to/from the btree page itself. */
69970 ** If pointing to a table btree, then the content section is read. If
70036 ** any btree routine is called.
70713 ** is a hint to the implement. SQLite btree implementation does not use
70823 ** hint to the implement. The native SQLite btree implementation does not
70914 BtShared *pBt, /* The btree */
71505 /* This is the common case where everything fits on the btree page
71773 ** a btree page has a value of 3 or less, the pCell value might point
71849 ** The order of cells is in the array is for an index btree is:
71857 ** For a table-btree (with rowids) the items 2 and 4 are empty because
71860 ** For an index btree, the apEnd[] array holds pointer to the end of page
71871 ** For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2]
72732 ** offset section of the btree page will be overwritten and we will no
73612 ** For a table btree (used for rowid tables), only the pX.nKey value of
73617 ** For an index btree (used for indexes and WITHOUT ROWID tables), the
74939 ** entry represents the span of a cell or freeblock on a btree page.
75268 Btree *p, /* The btree to be checked */
75484 ** a single shared-btree. The memory is used by client code for its own
75486 ** the shared-btree). The btree layer manages reference counting issues.
75488 ** The first time this is called on a shared-btree, nBytes bytes of memory
75497 ** Just before the shared-btree is closed, the function passed as the
75500 ** on the memory, the btree layer does that.
75515 ** btree as the argument handle holds an exclusive lock on the
75694 /************** End of btree.c ***********************************************/
76244 ** no need to check the return values of the btree methods here, as
76871 ** sqlite3_value_text()), or for ensuring that values to be used as btree
77631 ** Move data out of a btree key or data field and into a Mem structure.
77637 ** pMem->zMalloc to hold the content from the btree, if possible. New
77673 u32 available = 0; /* Number of bytes available on the local btree page */
81898 ** pointed to was deleted out from under it. Or maybe the btree was
89168 ** every btree page of the table. But if P3 is non-zero, an estimate
89378 ** back any currently active btree transactions. If there are any active
89707 ** and subsequently delete entries in an index btree. This is a
89810 ** since moved into the btree layer. */
89878 ** in btree.h. These flags control aspects of the operation of
89879 ** the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are
90098 ** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this
90165 ** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this
90378 ** unnecessary seeks on the btree, substituting steps to the next row
90398 ** is earlier in the btree than the target row, then fall through
90406 ** row does not exist in the btree) then jump to SeekOP.P2.
90553 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
90570 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
90586 ** record. Cursor P1 is an index btree. P2 is a jump destination.
90620 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
90623 ** P1 index btree has a matching key prefix. If there are no matches, jump
90731 ** P1 is the index of a cursor open on an SQL table btree (with integer
90755 ** P1 is the index of a cursor open on an SQL table btree (with integer
91489 ** Position cursor P1 at the end of the btree for the purpose of
91490 ** appending a new entry onto the btree.
91494 ** at the end of the btree and so no changes are made to
91661 ** The P3 value is a hint to the btree implementation. If P3==1, that
91689 ** The P3 value is a hint to the btree implementation. If P3==1, that
92157 /* All OP_Destroy operations occur on the same btree */
92288 ** on every btree. This is a prerequisite for invoking
93320 ** Lock the btree to which cursor P1 is pointing so that the btree cannot be
93335 ** Unlock the btree to which cursor P1 is pointing so that it can be
94483 /* This VDBE program seeks a btree cursor to the identified
110866 /* Open the database file. If the btree is successfully opened, use
113810 /* Bypass the creation of the PRIMARY KEY btree and the sqlite_schema
114490 ** used by SQLite when the btree layer moves a table root page. The
114533 ** if a root-page of another table is moved by the btree-layer whilst
114563 ** in case a root-page belonging to another table is moved by the btree layer
114669 ** at the btree level, in case the sqlite_sequence table needs to
118105 ** 1. iDataCur is an open cursor on the btree that is the canonical data
118280 ** btree for the table pTab. (This will be either the table itself
124631 u8 pik_flags; /* flag values passed to the btree insert */
125036 return 0; /* Corrupt schema - two indexes on the same btree */
139964 ** command. If the latter, then the row-records in the table btree on disk
140222 int iDataCur; /* Cursor for the canonical data btree */
141951 ** was committed at the btree level). So it safe to end the transaction
143434 struct { /* Information for internal btree tables */
143440 } btree;
143912 #define WHERE_INDEXED 0x00000200 /* WhereLoop.u.btree.pIndex is valid */
143995 Index *pIndex = pLoop->u.btree.pIndex;
143996 u16 nEq = pLoop->u.btree.nEq;
144010 explainAppendTerm(pStr, pIndex, pLoop->u.btree.nBtm, j, i, ">");
144014 explainAppendTerm(pStr, pIndex, pLoop->u.btree.nTop, j, i, "<");
144054 || ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
144072 assert( pLoop->u.btree.pIndex!=0 );
144073 pIdx = pLoop->u.btree.pIndex;
144149 if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 && pLoop->u.btree.pIndex!=0 ){
144150 zObj = pLoop->u.btree.pIndex->zName;
144430 && pLoop->u.btree.pIndex!=0
144431 && pLoop->u.btree.pIndex->aSortOrder[iEq]
144602 nEq = pLoop->u.btree.nEq;
144604 pIdx = pLoop->u.btree.pIndex;
144610 nReg = pLoop->u.btree.nEq + nExtraReg;
144854 sHint.pIdx = pLoop->u.btree.pIndex;
144903 if( pLoop->u.btree.nEq==0 && pTerm!=pEndRange ){
145383 assert( pLoop->u.btree.nEq==1 );
145554 u16 nEq = pLoop->u.btree.nEq; /* Number of == or IN terms */
145555 u16 nBtm = pLoop->u.btree.nBtm; /* Length of BTM vector */
145556 u16 nTop = pLoop->u.btree.nTop; /* Length of TOP vector */
145575 pIdx = pLoop->u.btree.pIndex;
145585 nExtraReg = MAX(nExtraReg, pLoop->u.btree.nBtm);
145592 nExtraReg = MAX(nExtraReg, pLoop->u.btree.nTop);
145733 ** on the estimated number of rows in the btree seems like a good
146186 && (ii==0 || pSubLoop->u.btree.pIndex==pCov)
146187 && (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex))
146190 pCov = pSubLoop->u.btree.pIndex;
149113 pLoop->u.btree.nEq = pLoop->nLTerm = nKeyCol;
149139 pLoop->u.btree.pIndex = pIdx;
149161 assert( (u32)n==pLoop->u.btree.nEq );
149698 Index *p = pLoop->u.btree.pIndex;
149699 int nEq = pLoop->u.btree.nEq;
149778 ** The value in (pBuilder->pNew->u.btree.nEq) is the number of the index
149815 Index *p = pLoop->u.btree.pIndex;
149816 int nEq = pLoop->u.btree.nEq;
149824 int nBtm = pLoop->u.btree.nBtm;
149825 int nTop = pLoop->u.btree.nTop;
149990 Index *p = pBuilder->pNew->u.btree.pIndex;
149991 int nEq = pBuilder->pNew->u.btree.nEq;
150054 Index *p = pBuilder->pNew->u.btree.pIndex;
150154 if( p->u.btree.pIndex && (zName = p->u.btree.pIndex->zName)!=0 ){
150160 sqlite3DebugPrintf(".%-16s %2d", zName, p->u.btree.nEq);
150210 }else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){
150211 sqlite3DbFree(db, p->u.btree.pIndex->zColAff);
150212 sqlite3DbFreeNN(db, p->u.btree.pIndex);
150213 p->u.btree.pIndex = 0;
150257 pFrom->u.btree.pIndex = 0;
150576 Index *pIndex = p->u.btree.pIndex;
150578 p->u.btree.pIndex = 0;
150743 ** We have so far matched pBuilder->pNew->u.btree.nEq terms of the
150769 u16 saved_nEq; /* Original value of pNew->u.btree.nEq */
150770 u16 saved_nBtm; /* Original value of pNew->u.btree.nBtm */
150771 u16 saved_nTop; /* Original value of pNew->u.btree.nTop */
150784 pNew->u.btree.nEq, pNew->nSkip, pNew->rRun));
150791 assert( pNew->u.btree.nBtm==0 );
150796 assert( pNew->u.btree.nEq<pProbe->nColumn );
150798 saved_nEq = pNew->u.btree.nEq;
150799 saved_nBtm = pNew->u.btree.nBtm;
150800 saved_nTop = pNew->u.btree.nTop;
150845 pNew->u.btree.nEq = saved_nEq;
150846 pNew->u.btree.nBtm = saved_nBtm;
150847 pNew->u.btree.nTop = saved_nTop;
150918 assert( saved_nEq==pNew->u.btree.nEq );
150936 pNew->u.btree.nBtm = whereRangeVectorLen(
150951 pNew->u.btree.nTop = 1;
150958 pNew->u.btree.nTop = whereRangeVectorLen(
150977 int nEq = ++pNew->u.btree.nEq;
150991 && pNew->u.btree.nEq<=pProbe->nSampleCol
151072 && pNew->u.btree.nEq<pProbe->nColumn
151082 pNew->u.btree.nEq = saved_nEq;
151083 pNew->u.btree.nBtm = saved_nBtm;
151084 pNew->u.btree.nTop = saved_nTop;
151111 pNew->u.btree.nEq++;
151122 pNew->u.btree.nEq = saved_nEq;
151247 SrcItem *pSrc; /* The FROM clause btree term to add */
151315 pNew->u.btree.nEq = 1;
151317 pNew->u.btree.pIndex = 0;
151365 pNew->u.btree.nEq = 0;
151366 pNew->u.btree.nBtm = 0;
151367 pNew->u.btree.nTop = 0;
151374 pNew->u.btree.pIndex = pProbe;
152120 pLoop->u.btree.nDistinctCol = 0;
152165 }else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
152185 assert( j>=pLoop->u.btree.nEq
152188 if( j<pLoop->u.btree.nEq && j>=pLoop->nSkip ){
152213 ** j<pLoop->u.btree.nEq constraint above. Any equality other
152217 for(i=j+1; i<pLoop->u.btree.nEq; i++){
152244 && j>=pLoop->u.btree.nEq
152276 pLoop->u.btree.nDistinctCol = j+1;
152295 if( j==pLoop->u.btree.nEq ){
152870 pLoop->u.btree.nEq = 1;
152894 pLoop->u.btree.nEq = j;
152895 pLoop->u.btree.pIndex = pIdx;
153506 if( pLoop->u.btree.pIndex!=0 ){
153521 Index *pIx = pLoop->u.btree.pIndex;
153677 && (pIdx = pLoop->u.btree.pIndex)->hasStat1
153678 && (n = pLoop->u.btree.nDistinctCol)>0
153755 VdbeComment((v, "next skip-scan on %s", pLoop->u.btree.pIndex->zName));
153851 pIdx = pLoop->u.btree.pIndex;
194393 /* Unable to write to the btree while another cursor is reading from it,
197159 /* Unable to write to the btree while another cursor is reading from it,
204380 /* Size information for a single cell within a btree page */
204390 /* Size information for a single btree page */
204423 int nPage; /* Number of pages in current btree */
204647 ** For a single cell on a btree page, compute the number of bytes of
204816 ** the next entry is the next btree.
204832 /* Start measuring space on the next btree */
204857 /* Continue analyzing the btree previously started */
204898 ** an entire btree, this is the exit point from this function */
204965 /* If computing aggregate space usage by btree, continue with the