Lines Matching refs:Index
100 ** limits the size of a row in a table or index.
113 ** * Columns in an index
1666 ** CAPI3REF: Maximum xShmLock index
2909 #define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */
2911 #define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
2918 #define SQLITE_DROP_INDEX 10 /* Index Name Table Name */
2920 #define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
2935 #define SQLITE_REINDEX 27 /* Index Name NULL */
3380 ** result set of a [SELECT] or the maximum number of columns in an index
3408 ** <dd>The maximum index number of any [parameter] in an SQL statement.)^
3674 ** ^The second argument is the index of the SQL parameter to be set.
3675 ** ^The leftmost SQL parameter has an index of 1. ^When the same named
3677 ** occurrences have the same index as the first occurrence.
3678 ** ^The index for named parameters can be looked up using the
3679 ** [sqlite3_bind_parameter_index()] API if desired. ^The index
3732 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3756 ** ^(This routine actually returns the index of the largest (rightmost)
3780 ** ^The first host parameter has an index of 1, not 0.
3795 ** CAPI3REF: Index Of A Parameter With A Given Name
3797 ** ^Return the index of an SQL parameter given its name. ^The
3798 ** index value returned is suitable for use as the second
4084 ** and the second argument is the index of the column for which information
4085 ** should be returned. ^The leftmost column of the result set has the index 0.
4090 ** column index is out of range, the result is undefined.
5551 ** ^(The index of the column is stored in
5605 int idxNum; /* Number used to identify the index */
5609 double estimatedCost; /* Estimated cost of using this index */
5778 ** ^It is not possible to open a column that is part of an index or primary
6583 ** an index.
7162 ** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement,
7168 ** or "DROP INDEX" query, an infinite loop might be the result.
7173 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7961 ** table or index. This is an unsigned integer type. For 99.9% of
8140 typedef struct Index Index;
8314 int iTable, /* Index of root page */
9865 #define SQLITE_IndexCover 0x10 /* Disable index covering table */
10155 ** If the table has an INTEGER PRIMARY KEY, then Table.iPKey is the index of
10164 ** database file. If Table.iDb is the index of the database table backend
10179 Index *pIndex; /* List of SQL indexes on this table. */
10258 int iFrom; /* Index of column in pFrom */
10306 ** comparison of the two index keys.
10318 ** single index record that has already been parsed out into individual
10323 ** the key of an index. A blob encoding of a record is created by
10346 ** Each SQL index is represented in memory by an
10351 ** we have the following table and index:
10354 ** CREATE INDEX Ex2 ON Ex1(c3,c1);
10357 ** three columns in the table. In the Index structure describing
10360 ** first column to be indexed (c3) has an index of 2 in Ex1.aCol[].
10361 ** The second column to be indexed (c1) has an index of 0 in
10364 ** The Index.onError field determines whether or not the indexed columns
10365 ** must be unique and what to do if they are not. When Index.onError=OE_None,
10366 ** it means this is not a unique index. Otherwise it is a unique index
10367 ** and the value of Index.onError indicate the which conflict resolution
10371 struct Index {
10372 char *zName; /* Name of this index */
10373 int *aiColumn; /* Which columns are used by this index. 1st is 0 */
10377 Index *pNext; /* The next index associated with the same table */
10378 Schema *pSchema; /* Schema containing this index */
10379 u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */
10380 char **azColl; /* Array of collation sequence names for index */
10381 int nColumn; /* Number of columns in the table used by this index */
10382 int tnum; /* Page containing root of this index in database file */
10385 u8 bUnordered; /* Use this index for == or IN queries only */
10429 ** pointer to this structure. The Expr.iColumn field is the index in
10440 u8 useSortingIdx; /* In direct mode, reference the sorting index rather
10442 int sortingIdx; /* Cursor number of the sorting index */
10444 int nSortingColumn; /* Number of columns in the sorting index */
10450 int iSorterColumn; /* Column number in the sorting index */
10518 ** character '?' in the original SQL) then the Expr.iTable holds the index
10576 ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
10669 u16 iAlias; /* Index into Parse.aAlias[] for zName */
10689 ** CREATE INDEX idx ON t(a,b,c);
10702 int idx; /* Index in some Table.aCol[] of a column named zName */
10762 Index *pIndex; /* Index structure corresponding to zIndex, if any */
10797 Index *pIdx; /* Index when WHERE_INDEXED is true */
10799 sqlite3_index_info *pVtabIdx; /* Virtual table index to use */
10809 ** The pIdxInfo field is used to help pick the best index on a
10839 ** we need a place to cache virtual table index information for each
10844 sqlite3_index_info *pIdxInfo; /* Index info for n-th source table */
10857 #define WHERE_FORCE_TABLE 0x0020 /* Do not use an index-only search */
10981 #define SRT_Union 1 /* Store result as keys in an index */
10982 #define SRT_Except 2 /* Remove result from a UNION index */
10991 #define SRT_Set 7 /* Store results as keys in an index */
11021 int iDb; /* Index in sqlite3.aDb[] of database holding pTab */
11665 SQLITE_PRIVATE Index *sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
11702 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
11734 SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int);
11861 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *, Index *);
11937 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*);
11938 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
11945 SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *);
12879 KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */
12880 int iDb; /* Index of cursor database in db->aDb[] (or -1) */
12890 Bool isIndex; /* True if an index containing keys only - no data */
16052 ** We often identify a chunk by its index in mem3.aPool[]. When
16053 ** this is done, the chunk index refers to the second block of
16054 ** the chunk. In this way, the first chunk has an index of 1.
16055 ** A chunk index of 0 means "no such chunk" and is the equivalent
16075 u32 next; /* Index in mem3.aPool[] of next free chunk */
16076 u32 prev; /* Index in mem3.aPool[] of previous free chunk */
16111 ** iMaster is the index of the master chunk. Most new allocations
16151 ** Unlink the chunk at index i from
16185 ** Link the chunk at index i into either the appropriate
16745 int next; /* Index of next free chunk */
16746 int prev; /* Index of previous free chunk */
16890 ** entry and return its index.
16918 int i; /* Index of a mem5.aPool[] slot */
16919 int iBin; /* Index into mem5.aiFreelist[] */
16983 /* Set iBlock to the index of the block pointed to by pOld in
28669 ** When multiple threads all reference the same wal-index, each thread
28671 ** of this unixShmNode object. In other words, each wal-index is opened
29065 ** Check to see if it has been allocated (i.e. if the wal-index file is
34881 sqlite3_int64 sz; /* Current size of wal-index file */
34886 ** Check to see if it has been allocated (i.e. if the wal-index file is
35906 u32 iSize; /* Maximum bit index. Max iSize is 4,294,967,296. */
38433 ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
38876 Pgno iSubRec; /* Index of first record in sub-journal */
44635 ** index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes
44650 ** In any case, all savepoints with an index greater than iSavepoint
44781 ** has been removed (CREATE INDEX needs to move a page when a statement
45178 ** lock on the database file and use heap-memory to store the wal-index
45188 ** heap-memory for the wal-index instead of the VFS shared-memory
45444 ** To start a read transaction, the reader records the index of the last
45458 ** data structure called the wal-index is maintained to expedite the
45461 ** WAL-INDEX FORMAT
45463 ** Conceptually, the wal-index is shared memory, though VFS implementations
45464 ** might choose to implement the wal-index using a mmapped file. Because
45465 ** the wal-index is shared memory, SQLite does not support journal_mode=WAL
45469 ** The wal-index is transient. After a crash, the wal-index can (and should
45471 ** to either truncate or zero the header of the wal-index when the last
45472 ** connection to it closes. Because the wal-index is transient, it can
45475 ** as big endian, the wal-index can store multi-byte values in the native
45478 ** The purpose of the wal-index is to answer this question quickly: Given
45479 ** a page number P, return the index of the last frame for page P in the WAL,
45482 ** The wal-index consists of a header region, followed by an one or
45483 ** more index blocks.
45485 ** The wal-index header contains the total number of frames within the WAL
45488 ** Each index block except for the first contains information on
45489 ** HASHTABLE_NPAGE frames. The first index block contains information on
45491 ** HASHTABLE_NPAGE are selected so that together the wal-index header and
45492 ** first index block are the same size as all other index blocks in the
45493 ** wal-index.
45495 ** Each index block contains two sections, a page-mapping that contains the
45497 ** that allows readers to query an index block for a specific page number.
45499 ** for the first index block) 32-bit page numbers. The first entry in the
45500 ** first index-block contains the database page number corresponding to the
45501 ** first frame in the WAL file. The first entry in the second index block
45505 ** The last index block in a wal-index usually contains less than the full
45512 ** can be found by scanning the page-mapping sections of each index block
45513 ** starting with the last index block and moving toward the first, and
45514 ** within each index block, starting at the end and moving toward the
45523 ** 1-based index of an entry in the mapping section of the same
45524 ** index block. Let K be the 1-based index of the largest entry in
45525 ** the mapping section. (For index blocks other than the last, K will
45526 ** always be exactly HASHTABLE_NPAGE (4096) and for the last index block
45538 ** be at index iUnused. (iUnused might be less than iKey if there was
45544 ** current index block. Otherwise the iMax-th mapping entry of the
45545 ** current index block corresponds to the last entry that references
45548 ** A hash search begins with the last index block and moves toward the
45549 ** first index block, looking for entries corresponding to page P. On
45550 ** average, only two or three slots in each index block need to be
45552 ** establish that no such entry exists in the block. Each index block
45553 ** holds over 4000 entries. So two or three index blocks are sufficient
45562 ** and to the wal-index) might be using a different value K1, where K1>K0.
45590 ** The maximum (and only) versions of the wal and wal-index formats
45597 ** Similarly, if a client successfully reads a wal-index header (i.e. the
45624 ** The following object holds a copy of the wal-index header content.
45626 ** The actual header in the wal-index consists of two copies of this
45634 u32 iVersion; /* Wal-index version */
45640 u32 mxFrame; /* Index of last valid frame in the WAL */
45648 ** A copy of the following object occurs in the wal-index immediately
45751 volatile u32 **apWiData; /* Pointer to wal-index content in memory */
45762 WalIndexHdr hdr; /* Wal-index header for current transaction */
45785 ** Each page of the wal-index mapping contains a hash-table made up of
45795 ** the largest index).
45814 } aSegment[1]; /* One for every 32KB page in the wal-index */
45818 ** Define the parameters of the hash tables in the wal-index file. There
45820 ** wal-index.
45822 ** Changing any of these constants will alter the wal-index format and
45831 ** wal-index is smaller than usual. This is so that there is a complete
45832 ** hash-table on each aligned 32KB page of the wal-index.
45836 /* The wal-index is divided into pages of WALINDEX_PGSZ bytes each. */
45842 ** Obtain a pointer to the iPage'th page of the wal-index. The wal-index
45843 ** is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are
45846 ** If this call is successful, *ppPage is set to point to the wal-index
45890 ** Return a pointer to the WalCkptInfo structure in the wal-index.
45898 ** Return a pointer to the WalIndexHdr structure in the wal-index.
45971 ** Write the header information in pWal->hdr into the wal-index.
46157 ** page iHash of the wal-index. The wal-index is broken into 32KB pages
46161 ** in the wal-index file. Set *piZero to one less than the frame
46172 volatile ht_slot **paHash, /* OUT: Pointer to hash index */
46202 ** Return the number of the wal-index page that contains the hash-table
46204 ** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
46300 ** Set an entry in the wal-index that will map database page number
46311 /* Assuming the wal-index file was successfully mapped, populate the
46383 ** Recover the wal-index by reading the write-ahead log file.
46386 ** wal-index to prevent other threads/processes from doing anything
46387 ** with the WAL or wal-index while recovery is running. The
46429 int iFrame; /* Index of last frame read */
46554 ** Close an open wal-index.
46575 ** client from unlinking the WAL or wal-index file. If another process
46584 sqlite3_vfs *pVfs, /* vfs module to open wal and wal-index */
46660 ** same WalIterator object. Write into *piFrame the frame index where
46670 u32 *piFrame /* OUT: Wal frame index of next page */
46708 ** of indices such that the aRight[] contains every index that appears in
46718 ** When that happens, omit the aLeft[X] and use the aRight[Y] index.
46728 int iLeft = 0; /* Current index in aLeft */
46729 int iRight = 0; /* Current index in aRight */
46730 int iOut = 0; /* Current index in output buffer */
46791 int iList; /* Index into input list */
46792 int iSub = 0; /* Index into aSub array */
46898 ht_slot *aIndex; /* Sorted index for this segment */
46949 ** The cache of the wal-index header must be valid to call this function.
46978 ** This routine uses and updates the nBackfill field of the wal-index header.
47021 /* Compute in mxSafeFrame the index of the last frame of the WAL that is
47159 int isDelete = 0; /* True to unlink wal and wal-index files */
47165 ** the wal and wal-index files.
47214 ** Try to read the wal-index header. Return 0 on success and 1 if
47217 ** The wal-index is in shared memory. Another thread or process might
47235 /* The first page of the wal-index must be mapped at this point. */
47243 ** There are two copies of the header at the beginning of the wal-index.
47277 ** Read the wal-index header from the wal-index and into pWal->hdr.
47279 ** wal-index from the WAL before returning.
47281 ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is
47285 ** If the wal-index header is successfully read, return SQLITE_OK.
47291 volatile u32 *page0; /* Chunk of wal-index containing header */
47293 /* Ensure that page 0 of the wal-index (the page that contains the
47294 ** wal-index header) is mapped. Return early if an error occurs here.
47303 /* If the first page of the wal-index has been mapped, try to read the
47304 ** wal-index header immediately, without holding any lock. This usually
47305 ** works, but may fail if the wal-index header is corrupt or currently
47325 /* If the wal-index header is still malformed even while holding
47339 ** sure the wal-index was not constructed with some future format that
47367 ** to make a copy of the wal-index header into pWal->hdr. If the
47368 ** wal-index header has changed, *pChanged is set to 1 (as an indication
47370 ** flushed.) When useWal==1, the wal-index header is assumed to already
47381 ** bad luck when there is lots of contention for the wal-index, but that
47406 volatile WalCkptInfo *pInfo; /* Checkpoint information in wal-index */
47408 int mxI; /* Index of largest aReadMark[] value */
47547 ** value in the aReadMark[] array or the contents of the wal-index
47550 ** It is necessary to check that the wal-index header did not change
47560 ** This does not guarantee that the copy of the wal-index header is up to
47584 ** it takes a snapshot of the state of the WAL and wal-index for the current
47586 ** Other threads might append new content to the WAL and wal-index but
47642 /* If the "last page" field of the wal-index header snapshot is 0, then
47658 ** that adds entries to the wal-index (and possibly to this hash
47682 int iKey; /* Hash slot index */
47705 ** of the wal-index file content. Make sure the results agree with the
47829 /* Restore the clients cache of the wal-index header to the state it
47931 ** wal-index header to reflect this.
47934 ** at this point. But updating the actual wal-index header is also
48187 /* Append data to the wal-index. It is not necessary to lock the
48188 ** wal-index to do this as the SQLITE_SHM_WRITE lock held on the wal-index
48213 /* If this is a commit, update the wal-index header too. */
48246 int isChanged = 0; /* True if a new wal-index header is loaded */
48282 /* Read the wal-index header. */
48303 /* If a new wal-index header was loaded before the checkpoint was
48305 ** out of date. So zero the cached wal-index header to ensure that
48397 ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
48474 ** BTrees. Each BTree is identified by the index of its root page. The
48662 ** plus 2 bytes for the index to the cell in the page header). Such
48720 u16 cellOffset; /* Index in aData of first cell pointer */
48730 u8 *aCellIdx; /* The cell index area */
48919 ** The entry is identified by its MemPage and the index in
48950 i16 iPage; /* Index of current page in apPage */
48951 u16 aiIdx[BTCURSOR_MAX_DEPTH]; /* Current index in apPage[i] */
49474 ** When writing to an index that resides in a sharable database, the
49478 ** the table corresponding to the index being written, this
49481 ** Instead of a lock on the table/index rooted at page iRoot, the caller may
49488 int isIndex, /* True if iRoot is the root of an index b-tree */
49505 /* If the client is reading or writing an index and the schema is
49516 ** written. For index b-trees, it is the root page of the associated
49521 Index *pIdx = (Index *)sqliteHashData(p);
49552 ** table or index rooted at iRoot because other shared connections are
49553 ** simultaneously reading that same table or index.
49561 ** For example, before writing to any part of the table or index
50007 ** In this version of BtreeMoveto, pKey is a packed index record
50013 const void *pKey, /* Packed key if the btree is an index */
50019 UnpackedRecord *pIdxKey; /* Unpacked index key */
50181 int iPtrmap; /* Pointer map page index */
50217 ** Given a btree page and a cell index (0 means the first cell on
50251 ** cell index as the second argument and btreeParseCellPtr()
50327 int iCell, /* The cell index. First cell is 0 */
50437 int iCellFirst; /* First allowable cell index */
50438 int iCellLast; /* Last possible cell index */
50505 ** as the first argument. Write into *pIdx the index into pPage->aData[]
50794 int i; /* Index into the cell pointer array */
52298 Pgno iFreePg; /* Index of free page to move pLastPg to */
52743 ** an index greater than all savepoints created explicitly using
53572 ** pCur->idx is set to the cell index that contains the pointer
53575 ** the largest cell index.
53621 ** structure the flags byte is set to 0x02 or 0x0A, indicating an index
53660 ** expected to open it on an index b-tree. Otherwise, if pKeyInfo is
53815 ** must be NULL. For index tables, pIdxKey is used and intKey
53841 UnpackedRecord *pIdxKey, /* Unpacked index key */
53891 ** be the right kind (index or table) of b-tree page. Otherwise
53927 ** the maximum number of record bytes stored on an index B-Tree
54237 /* Decrement the free-list count by 1. Set iTrunk to the index of the
54876 ** Insert a new cell on pPage at cell index "i". pCell points to the
54883 ** in pTemp or the original pCell) and also record its index.
54904 int ins; /* Index in data[] where new cell pointer is inserted */
55285 int iParentIdx, /* Index of "the page" in pParent */
55310 int cntNew[NB+2]; /* Index in aCell[] of cell after i-th page */
55327 ** index iParentIdx. This scenario comes about when this function
55521 ** size of all cells on the i-th page and cntNew[] which is the index
55529 ** cntNew[i]: Index in apCell[] and szCell[] for the first cell to
55564 int r; /* Index of right-most cell in left sibling */
55565 int d; /* Index of first cell to the left of right sibling */
56150 ** expecting an index b-tree, then the caller should be inserting blob
56270 int iCellIdx; /* Index of cell to delete */
56829 int iIdx; /* Index of child node in parent */
56844 ** pCur->aiIdx[pCur->iPage] value is set to the index of the parent cell
58903 ** empty boolean index.
61225 int idx, /* Index of column zName applies to */
62048 ** data and index records. Each serialized value consists of a
62052 ** In an SQLite index record, the serial type is stored directly before
62435 ** This function compares the two table rows or index records
62550 ** pCur points at an index entry created using the OP_MakeRecord opcode.
62567 /* Get the size of the index entry. Only indices entries of less
62577 /* Read in the complete content of the index entry */
62584 /* The index entry must begin with a header size */
62592 /* The last field of the index should be an integer - the ROWID.
62612 /* Fetch the integer off the end of the index record */
62627 ** Compare the key of the index entry that cursor pC is pointing to against
62633 ** omits the rowid at the end. The rowid at the end of the index entry
63781 int i, /* Index of the parameter to bind */
63926 ** Return the name of a wildcard parameter. Return NULL if the index
63940 ** Given a wildcard parameter name, return the index of the variable
64124 ** the host parameter index is found by scanning the perpared
64126 ** parameter index is known, locate the value in p->aVar[]. Then render
64134 int idx = 0; /* Index of a host parameter */
64135 int nextIndex = 1; /* Index of next ? host parameter */
64525 int iCur, /* Index of the new VdbeCursor */
64526 int nField, /* Number of fields in the table or index */
65086 u8 *zIdx; /* Index into header */
65196 UnpackedRecord r; /* B-Tree index search key */
65592 ** the one at index P2 from the beginning of
67019 u8 *zIdx; /* Index into header */
67328 ** in an index. The OP_Column opcode can decode the record later.
67332 ** field of the index key.
67337 ** If P4 is NULL then all index fields have the affinity NONE.
67460 ** Store the number of entries (an integer value) in the table or index
67730 ** P1 is the index of the database file on which the transaction is
67731 ** started. Index 0 is the main database file and index 1 is the
67852 /* See note about index shifting on OP_ReadCookie */
67957 ** sequence of the index being opened. Otherwise, if P4 is an integer
67964 ** Open a read/write cursor named P1 on the table or index whose root
67971 ** sequence of the index being opened. Otherwise, if P4 is an integer
67973 ** largest index of any column of the table that is actually used.
68070 ** The cursor points to a BTree table if P4==0 and to a BTree index
68072 ** that defines the format of keys in the index.
68114 /* If a transient index is required, create it by calling
68144 ** a transient index that is specifically designed to sort large
68211 ** to an SQL index, then P3 is the first in an array of P4 registers
68212 ** that are used as an unpacked index key.
68224 ** to an SQL index, then P3 is the first in an array of P4 registers
68225 ** that are used as an unpacked index key.
68237 ** to an SQL index, then P3 is the first in an array of P4 registers
68238 ** that are used as an unpacked index key.
68250 ** to an SQL index
68251 ** that are used as an unpacked index key.
68448 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
68458 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
68531 ** Cursor P1 is open on an index b-tree - that is to say, a btree which
68533 ** the list field being the integer ROWID of the entry that the index
68538 ** that make up an unpacked index key that can be used with cursor P1.
68540 ** value appended to the end of the index record. This rowid value may
68548 ** of the index entry is not R. If there is no such entry, control jumps
68549 ** to instruction P2. Otherwise, the rowid of the conflicting index
68562 UnpackedRecord r; /* B-Tree index search key */
68573 /* Find the index cursor. */
68592 /* Populate the index search key. */
68605 /* Search the B-Tree index. If no conflicting record is found, jump
68628 ** P1 is an index.
69235 ** will refer to the last entry in the database table or index.
69236 ** If the table or index is empty and P2>0, then jump immediately to P2.
69237 ** If P2 is 0 or if the table or index is not empty, fall through
69271 ** Sorting is accomplished by writing records into a sorting index,
69272 ** then rewinding that index and playing it back from beginning to
69293 ** will refer to the first entry in the database table or index.
69294 ** If the table or index is empty and P2>0, then jump immediately to P2.
69295 ** If P2 is 0 or if the table or index is not empty, fall through
69332 ** table or index. If there are no more key/value pairs then fall through
69349 ** table or index. If there is no previous key/value pairs then fall through
69406 ** Register P2 holds an SQL index key made using the
69408 ** into the index P1. Data for the entry is nil.
69458 ** an unpacked index key. This opcode removes that entry from the
69459 ** index opened by cursor P1.
69496 ** the end of the index key pointed to by cursor P1. This integer should be
69497 ** the rowid of the table entry to which this index entry points.
69532 ** The P4 register values beginning with P3 form an unpacked index
69533 ** key that omits the ROWID. Compare this key value against the index
69534 ** that P1 is currently pointing to, ignoring the ROWID on the P1 index.
69536 ** If the P1 index entry is greater than or equal to the key value
69546 ** The P4 register values beginning with P3 form an unpacked index
69547 ** key that omits the ROWID. Compare this key value against the index
69548 ** that P1 is currently pointing to, ignoring the ROWID on the P1 index.
69550 ** If the P1 index entry is less than the key value then jump to P2.
69599 ** Delete an entire database table or index whose root page in the database
69659 ** Delete all contents of the database table or index whose root page
69661 ** remove the table or index from the database file.
69668 ** intkey table (an SQL table, not an index). In this case the row change
69703 ** The difference between a table and an index is this: A table must
69704 ** have a 4-byte integer key and can have arbitrary data. An index
69711 ** Allocate a new index in the main database file if P1==0 or in the
69803 ** of that table into the internal index hash table. This will cause
69828 ** the index named P4 in database P1. This is called after an index
69916 ** Insert the integer value held by register P2 into a boolean index
69935 ** Extract the smallest value from boolean index P1 and put that value into
69936 ** register P3. Or, if boolean index P1 is initially empty, leave P3
69948 /* The boolean index is empty */
69952 /* A value was pulled from the index */
70586 ** P1 is the index of the database in sqlite3.aDb[] of the database
70743 /* Grab the index number and argc parameters */
71291 int iCol; /* Index of zColumn in row-record */
71391 Index *pIdx;
71659 ** example, by CREATE INDEX statements on tables too large to fit in main
71694 ** aTree element is set to the index of it.
71698 ** values), it doesn't matter which index is stored.
71701 ** above contains the index of the smallest of each block of 4 iterators.
71702 ** And so on. So that aTree[1] contains the index of the iterator that
71981 ** multiple b-tree segments. Parameter iOut is the index of the aTree[]
72027 ** Initialize the temporary index cursor just opened as a sorter cursor.
72366 int iNew; /* Index of new, merged, PMA */
72443 int iPrev = pSorter->aTree[1];/* Index of iterator to advance */
72444 int i; /* Index of aTree[] to recalculate */
73291 ** pExpr->iDb Set the index in db->aDb[] of the database X
73821 ** ORDER BY term is not an integer index into the result set. That
73825 ** SELECT statement. Return the index i of the matching column,
73864 ** in the result set. Return an 1-based index of the matching
73883 int i, /* The index (1-based) of the term out of range */
74298 ** Expr.iColumn The column index in X.Y. -1 for the rowid.
74569 ** if the index with affinity idx_affinity may be used to implement
75786 ** The index of the cursor opened on the b-tree (database table, database index
75791 ** IN_INDEX_INDEX - The cursor was opened on a database index.
75804 ** has a UNIQUE constraint or UNIQUE index.
75808 ** be used unless <column> is an INTEGER PRIMARY KEY or an index can
75844 /* Check to see if an existing table or index can be used to
75853 int iCol; /* Index of column <column> */
75884 Index *pIdx; /* Iterator variable */
75886 /* The collation sequence used by the comparison. If an index is to
75893 ** it is not, it is not possible to use any index.
75925 /* Could not found an existing table or index to use as the RHS b-tree.
76035 ** filled with single-field index keys representing the results
76040 ** column is used to build the index keys. If both 'x' and the
76077 ** For each expression, build an index key from the evaluation and
76079 ** that columns affinity when building index keys. If <expr> is not
76255 /* In this case, the RHS is an index b-tree.
76541 int iCol, /* Index of the column to extract */
76567 int iColumn, /* Index of the table column */
77107 ** i is the index of the column. For a new.rowid reference, p1 is
78162 ** Add a new element to the pAggInfo->aCol[] array. Return the index of
78178 ** Add a new element to the pAggInfo->aFunc[] array. Return the index of
78458 ** CREATE INDEX command. The second is a table name. The table name in
78459 ** the CREATE TABLE or CREATE INDEX statement is replaced with the third
78465 ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
78466 ** -> 'CREATE INDEX i ON def(a, b, c)'
78586 ** TRIGGER, not CREATE INDEX and CREATE TABLE.
78766 int iDb; /* Index of database containing pTab */
78786 /* Drop the table and index from the internal schema. */
78789 /* Reload the table, index and permanent trigger schemas. */
78858 /* Check that a table or index named 'zName' does not already exist
78863 "there is already another table or index with this name: %s", zName);
78961 "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN "
78965 "(type='table' OR type='index' OR type='trigger');",
79295 ** There is normally one row per index, with the index identified by the
79297 ** which the index belongs. In each such row, the stat column will be
79299 ** list is the number of rows in the index and in the table. The second
79300 ** integer is the average number of rows in the index that have the same
79301 ** value in the first column of the index. The third integer is the average
79302 ** number of rows in the index that have the same value for the first two
79304 ** the index which have the same value for the first N-1 columns. For
79305 ** a K-column index, there will be K+1 integers in the stat column. If
79306 ** the index is unique, then the last integer will be 1.
79312 ** the index is unordered and will not use the index for a range query.
79323 ** about the distribution of keys within an index. The index is identified by
79325 ** the index belongs. There are usually 10 rows in the sqlite_stat2
79326 ** table for each index.
79328 ** The sqlite_stat2 entries for an index that have sampleno between 0 and 9
79329 ** inclusive are samples of the left-most key value in the index taken at
79330 ** evenly spaced points along the index. Let the number of samples be S
79331 ** (10 in the standard build) and let C be the number of rows in the index.
79336 ** For i between 0 and S-1. Conceptually, the index space is divided into
79350 ** the sqlite_stat2 table. There are multiple entries for each index.
79351 ** The idx column names the index and the tbl column is the table of the
79352 ** index. If the idx and tbl columns are the same, then the sample is
79354 ** the left-most column of the index. The nEq column is the approximate
79355 ** number of entires in the index whose left-most column exactly matches
79358 ** number of distinct left-most entries in the index that are less than
79363 ** integer will be the number of prior index entires that are distinct in
79364 ** the left-most column. The second integer will be the number of prior index
79366 ** will be the number of prior index entries that are distinct in the first
79370 ** There can be an arbitrary number of sqlite_stat3 entries per index.
79398 const char *zWhere, /* Delete entries for this table or index */
79480 int iMin; /* Index of entry with minimum nEq and hash */
79497 ** are the number of rows in the table or index (C) and the number of samples
79691 Index *pOnlyIdx, /* If not NULL, only analyze this one index */
79692 int iStatCur, /* Index of VdbeCursor that writes the sqlite_stat1 table */
79696 Index *pIdx; /* An index to being analyzed */
79697 int iIdxCur; /* Cursor open on index being analyzed */
79703 int iDb; /* Index of database containing pTab */
79705 int regIdxname = iMem++; /* Register containing index name */
79715 int regCount = iMem++; /* Number of rows in the table or index */
79772 /* Open a cursor to the index to be analyzed. */
79778 /* Populate the register containing the index name. */
79803 ** Number of distinct entries in index considering the
79821 ** the index b-tree. */
79906 ** two columns are the names of the table and index. The third column
79908 ** index. The first integer in the list is the total number of entries
79909 ** in the index. There is one additional integer in the list for each
79911 ** rows of the table the index will select. If D is the count of distinct
79941 ** containing NULL as the index name and the row count as the content.
79964 ** Generate code that will cause the most recent index analysis to
79999 ** a database. If pOnlyIdx is not NULL then it is a single index
80002 static void analyzeTable(Parse *pParse, Table *pTab, Index *pOnlyIdx){
80039 Index *pIdx;
80101 ** This callback is invoked once for each index when reading the
80105 ** argv[1] = name of the index (might be NULL)
80113 Index *pIndex;
80155 ** If the Index.aSample variable is not NULL, delete the aSample[] array
80158 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
80182 ** Load content from the sqlite_stat3 table into the Index.aSample[]
80189 Index *pPrevIdx = 0; /* Previous index in the loop */
80210 char *zIndex; /* Index name */
80211 Index *pIdx; /* Pointer to the index object */
80242 char *zIndex; /* Index name */
80243 Index *pIdx; /* Pointer to the index object */
80311 ** contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
80313 ** Index.aSample[] arrays.
80341 Index *pIdx = sqliteHashData(i);
80813 const char *zType, /* "view", "trigger", or "index" */
80814 const Token *pName /* Name of the view, trigger, or index */
80834 ** These routines are used to make sure that an index, trigger, or
81050 int iDb /* Index of containing database. */
81088 int iSrc; /* Index in pTabList->a[] of table being read */
81089 int iDb; /* The index of the database the expression refers to */
81090 int iCol; /* Index of column in table */
81215 ** CREATE INDEX
81216 ** DROP INDEX
81256 int iDb, /* Index of the database containing the table to lock */
81520 ** a particular index given the name of that index
81521 ** and the name of the database that contains the index.
81525 ** table and the first matching index is returned. (No checking
81526 ** for duplicate index names is done.) The search order is
81530 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
81531 Index *p = 0;
81549 ** Reclaim the memory used by an index
81551 static void freeIndex(sqlite3 *db, Index *p){
81560 ** For the index called zIdxName which is found in the database iDb,
81561 ** unlike that index from its Table then remove the index from
81562 ** the index hash table and free all memory structures associated
81563 ** with the index.
81566 Index *pIndex;
81578 Index *p;
81579 /* Justification of ALWAYS(); The index must be on the list of
81703 Index *pIndex, *pNext;
81717 TESTONLY ( Index *pOld = ) sqlite3HashInsert(
81805 ** function returns the index of the named database in db->aDb[], or
81826 ** index of the named database in db->aDb[], or -1 if the named db
81851 ** pName2) that stores the unqualified table name. The index of the
81886 ** unqualified name for a new schema object (table, index, view or
81947 ** set to the index of the database that the table or view is to be
81995 ** index or table name in the same database. Issue an error message if
82017 sqlite3ErrorMsg(pParse, "there is already an index named %s", zName);
82324 ** field of the table under construction to be the index of the
82329 ** index for the key. No index is created for INTEGER PRIMARY KEYs.
82379 Index *p;
82428 Index *pIdx;
82432 ** then an index may have been created on this column before the
83052 ** root-page of a table or index in database iDb has changed from iFrom
83058 ** have the same rootpage number as the real table or index that is
83061 ** or tables and not the table/index that is actually being moved.
83083 Index *pIdx = sqliteHashData(pElem);
83127 Index *pIdx;
83136 ** table and index root-pages in order, starting with the numerically
83154 Index *pIdx;
83180 ** after a DROP INDEX or DROP TABLE command.
83186 const char *zName /* Name of index or table */
83247 /* Drop all SQLITE_MASTER table and index entries that refer to the
83523 ** Generate code that will erase and refill index *pIdx. This is
83524 ** used to initialize a newly created index or to recompute the
83525 ** content of an index in response to a REINDEX command.
83527 ** if memRootPage is not negative, it means that the index is newly
83529 ** root page number of the index. If memRootPage is negative, then
83530 ** the index already exists and must be cleared before being refilled and
83531 ** the root page number of the index is taken from pIndex->tnum.
83533 static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
83540 int tnum; /* Root page of index */
83542 KeyInfo *pKey; /* KeyInfo for index */
83544 int regIdxKey; /* Registers containing the index key */
83546 int regRecord; /* Register holding assemblied index record */
83583 /* Open the table. Loop through all rows of the table, inserting index
83643 ** Create a new index for an SQL table. pName1.pName2 is the name of the index
83645 ** be NULL for a primary key or an index that is created to satisfy a
83654 ** If the index is created successfully, return a pointer to the new Index
83655 ** structure. This is used by sqlite3AddPrimaryKey() to mark the index
83656 ** as the tables primary key (Index.autoIndex==2).
83658 SQLITE_PRIVATE Index *sqlite3CreateIndex(
83660 Token *pName1, /* First part of index name. May be NULL */
83661 Token *pName2, /* Second part of index name. May be NULL */
83662 SrcList *pTblName, /* Table to index. Use pParse->pNewTable if 0 */
83666 Token *pEnd, /* The ")" that closes the CREATE INDEX statement */
83668 int ifNotExist /* Omit error if index already exists */
83670 Index *pRet = 0; /* Pointer to return */
83672 Index *pIndex = 0; /* The index to be created */
83673 char *zName = 0; /* Name of the index */
83678 int sortOrderMask; /* 1 to honor DESC in index. 0 to ignore. */
83681 int iDb; /* Index of the database that is being written */
83682 Token *pName = 0; /* Unqualified name of the index to create */
83702 /* Use the two-part index name to determine the database
83712 /* If the index name was unqualified, check if the the table
83724 if( sqlite3FixInit(&sFix, pParse, iDb, "index", pName) &&
83765 ** Find the name of the index. Make sure there is not already another
83766 ** index or table with the same name.
83770 ** one of the index names collides with the name of a temporary table or
83771 ** index, then we will continue to process this index.
83792 sqlite3ErrorMsg(pParse, "index %s already exists", zName);
83801 Index *pLoop;
83809 /* Check for authorization to create an index.
83854 ** Allocate the index structure.
83859 ROUND8(sizeof(Index)) + /* Index structure */
83860 ROUND8(sizeof(tRowcnt)*(nCol+1)) + /* Index.aiRowEst */
83861 sizeof(char *)*nCol + /* Index.azColl */
83862 sizeof(int)*nCol + /* Index.aiColumn */
83863 sizeof(u8)*nCol + /* Index.aSortOrder */
83864 nName + 1 + /* Index.zName */
83871 pIndex->aiRowEst = (tRowcnt*)&zExtra[ROUND8(sizeof(Index))];
83888 /* Check to see if we should honor DESC requests on index columns
83897 ** load the column indices into the Index structure. Report an error
83901 ** more than once within the same index. Only the first instance of
83952 /* This routine has been called to create an automatic index as a
83960 ** Either way, check to see if the table already has such an index. If
83973 Index *pIdx;
83991 /* This constraint creates the same index as a previous
83996 ** explicitly specified behaviour for the index.
84011 /* Link the new Index structure to its table and to the other
84015 Index *p;
84031 /* If the db->init.busy is 0 then create the index on disk. This
84032 ** involves writing the index into the master table and filling in the
84033 ** index with the current table contents.
84035 ** The db->init.busy is 0 when the user first enters a CREATE INDEX
84037 ** CREATE INDEX statements are read out of the master table. In
84038 ** the latter case the index already exists on disk, which is why
84041 ** If pTblName==0 it means this index is generated as a primary key
84043 ** has just been created, it contains no data and the index initialization
84055 /* Create the rootpage for the index
84060 /* Gather the complete text of the CREATE INDEX statement into
84065 /* A named index with an explicit CREATE INDEX statement */
84066 zStmt = sqlite3MPrintf(db, "CREATE%s INDEX %.*s",
84071 /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
84076 /* Add an entry in sqlite_master for this index
84079 "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);",
84088 /* Fill the index with data and reparse the schema. Code an OP_Expire
84095 sqlite3MPrintf(db, "name='%q' AND type='index'", pIndex->zName));
84100 /* When adding an index to the list of indices for a table, make
84112 Index *pOther = pTab->pIndex;
84136 ** Fill the Index.aiRowEst[] array with default information - information
84139 ** aiRowEst[0] is suppose to contain the number of elements in the index.
84142 ** first column of the index. aiRowEst[2] is an estimate of the number
84144 ** of the index. And so forth. It must always be the case that
84153 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
84171 ** This routine will drop an existing named index. This routine
84172 ** implements the DROP INDEX statement.
84175 Index *pIndex;
84191 sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0);
84199 sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
84220 /* Generate code to remove the index and from the master table */
84225 "DELETE FROM %Q.%s WHERE name=%Q AND type='index'",
84247 ** The index of the new entry is returned in *pIdx.
84258 int *pIdx /* Write the index of a new slot here */
84319 ** Return the index in pList of the identifier named zId. Return -1
84354 int iStart /* Index in pSrc->a[] of first new slot */
84465 ** Assign VdbeCursor index numbers to all tables in a SrcList
84803 ** inserting multiple rows in a table, or inserting a row and index entries.)
84851 static int collationMatch(const char *zColl, Index *pIndex){
84871 Index *pIndex; /* An index associated with pTab */
84891 int iDb; /* The database index number */
84917 ** collating function. Forms 3 and 4 rebuild the named index or all
84923 char *z; /* Name of a table or index */
84926 Index *pIndex; /* An index associated with pTab */
84927 int iDb; /* The database index number */
84929 Token *pObjName; /* Name of the table or index to be reindexed */
84977 ** with OP_OpenRead or OP_OpenWrite to access database index pIdx.
84985 SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
85499 ** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
85704 Index *pIdx; /* For looping over indices of the table */
85943 ** cursor number base+i for the i-th index.
85949 ** index entries that point to that record.
86014 /* Delete the index and table entries. Skip this step if pTab is really
86043 ** index entries associated with a single row of a single table.
86052 ** cursor number iCur+i for the i-th index.
86064 Index *pIdx;
86075 ** Generate code that will assemble an index key and put it in register
86076 ** regOut. The key with be for index pIdx which is an index on pTab.
86077 ** iCur is the index of a cursor open on the pTab table and pointing to
86081 ** registers that holds the elements of the index key. The
86087 Index *pIdx, /* The index for which to generate a key */
86089 int regOut, /* Write the new index key to this register */
87886 ** search the schema a unique index on the parent key columns.
87890 ** is set to point to the unique index.
87896 ** array is the index of the child table column that is mapped by the FK
87898 ** of index *ppIdx. The second element of the array is the index of the
87902 ** If the required index cannot be found, either because:
87925 FKey *pFKey, /* Foreign key to find index for */
87926 Index **ppIdx, /* OUT: Unique index on parent table */
87927 int **paiCol /* OUT: Map of index columns in pFKey */
87929 Index *pIdx = 0; /* Value to return via *ppIdx */
87968 /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number
87970 ** column of pFKey, then this index is a winner. */
87974 ** the PRIMARY KEY of table pParent. The PRIMARY KEY index may be
87975 ** identified by the test (Index.autoIndex==2). */
87986 ** index matches those columns. Also, check that the index uses
87990 int iCol = pIdx->aiColumn[i]; /* Index of column in parent tbl */
87994 /* If the index uses a collation sequence that is different from
87995 ** the default collation sequence for the column, this index is
88057 int iDb, /* Index of database housing pTab */
88059 Index *pIdx, /* Unique index on parent key columns in pTab */
88214 Index *pIdx, /* Foreign key index */
88246 int iCol; /* Index of column in child table */
88421 ** For a DELETE operation, parameter regOld is passed the index of the
88444 int iDb; /* Index of database containing pTab */
88461 Index *pIdx = 0; /* Index on key columns in pTo */
88468 /* Find the parent table of this foreign key. Also find a unique index
88524 ** a cursor to use to search the unique index on the parent key columns
88546 Index *pIdx = 0; /* Foreign key index for pFKey */
88611 Index *pIdx = 0;
88728 Index *pIdx = 0; /* Parent key index for this FK */
88985 int iDb, /* The database index in sqlite3.aDb[] */
89000 ** Return a pointer to the column affinity string associated with index
89013 ** rowid that appears as the last column in every index.
89015 ** Memory for the buffer containing the column index affinity string
89016 ** is managed along with the rest of the Index structure. It will be
89019 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
89021 /* The first time a column affinity string for a particular index is
89023 ** a member of the Index structure for subsequent use.
89026 ** sqliteDeleteIndex() when the Index structure itself is cleaned
89050 ** for each column indexed by the index, according to the affinity of the
89110 Index *pIndex;
89155 int iDb, /* Index of the database holding pTab */
89336 ** foreach index on <table>
89337 ** open a write cursor on the <table> index
89338 ** open a read cursor on the corresponding <table2> index
89410 Index *pIdx; /* For looping over indices of the table */
89422 int iDb; /* Index of database holding TABLE */
89434 int *aRegIdx = 0; /* One register allocated to each index */
89669 ** the index into IDLIST of the primary key column. keyColumn is
89670 ** the index of the primary key as it appears in IDLIST, not as
89671 ** is appears in the original table. (The index of the primary
89702 ** key, the set the keyColumn variable to the primary key column index
89927 /* Generate code to check constraints and generate index keys and
90039 ** The regRowid parameter is the index of the register containing (1).
90050 ** The code generated by this routine store new index entries into
90051 ** registers identified by aRegIdx[]. No index entry is created for
90104 int baseCur, /* Index of a read/write cursor pointing at pTab */
90105 int regRowid, /* Index of the range of input registers */
90106 int *aRegIdx, /* Register used by each index. 0 for unused indices */
90121 Index *pIdx; /* Pointer to one of the indices */
90226 ** the triggers and remove both the table and index b-tree entries.
90230 ** GenerateRowIndexDelete(). This removes the index b-tree entries
90274 ** index and making sure that duplicate entries do not already exist.
90283 /* Create a key for accessing the index entry */
90302 continue; /* pIdx is not a UNIQUE index */
90314 /* Check to see if the new index entry will be unique */
90322 /* Generate code that executes if the new index entry is not unique */
90390 int baseCur, /* Index of a read/write cursor pointing at pTab */
90392 int *aRegIdx, /* Register used by each index. 0 for unused indices */
90400 Index *pIdx;
90455 Index *pIdx;
90504 ** Check to see if index pSrc is compatible as a source of data
90505 ** for index pDest in an insert transfer optimization. The rules
90506 ** for a compatible index:
90508 ** * The index is over the same set of columns
90513 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
90546 ** performance. Raw index records are transferred in the same way.
90573 Index *pSrcIdx, *pDestIdx; /* Source and destination indices */
90582 KeyInfo *pKey; /* Key information for an index */
90584 int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
90685 return 0; /* pDestIdx has no corresponding index in pSrc */
90734 ** of index entries might need to change.)
90736 ** (2) The destination has a unique index. (The xfer optimization
92377 int iDb; /* Database index for <database> */
92389 ** index of the database this pragma is being applied to in db.aDb[]. */
93003 Index *pIdx;
93027 Index *pIdx;
93220 Index *pIdx;
93250 Index *pIdx;
93281 sqlite3VdbeChangeP4(v, addr+3, " missing from index ", P4_STATIC);
93311 "wrong # of entries in index ", P4_STATIC);
93411 ** creating or dropping a table or index). The schema version is used by
93426 int iCookie; /* Cookie index. 1 for schema-cookie, 6 for user-cookie. */
93685 ** argv[1] = root page number for table or index. 0 for trigger or view.
93708 /* Call the parser to process a CREATE TABLE, INDEX or VIEW.
93711 ** structures that describe the table, index, or view.
93741 /* If the SQL column is blank it means this is an index that
93743 ** constraint for a CREATE TABLE. The index should have already
93745 ** to do here is record the root page number for that index.
93747 Index *pIndex;
93750 /* This can occur if there exists an index on a TEMP table which
93751 ** has the same name as another index on a permanent index. Since
93753 ** safely ignore the index on the permanent table.
93765 ** data structures for a single database file. The index of the
94128 ** Convert a schema pointer into the iDb index that indicates
94143 ** -1000000 as the incorrect index into db->aDb[] is much
94687 ** Return the index of a column in a table. Return -1 if the column
94702 ** When found, set *piTab and *piCol to the table index and column index
94711 int *piTab, /* Write index of pSrc->a[] here */
94712 int *piCol /* Write index of pSrc->a[*piTab].pTab->aCol[] here */
94715 int iCol; /* Index of column matching zCol */
94745 int iLeft, /* Index of first table to join in pSrc */
94746 int iColLeft, /* Index of column in first table */
94747 int iRight, /* Index of second table in pSrc */
94748 int iColRight, /* Index of column in second table */
94980 ** form a distinct entry. iTab is a sorting index that holds previously
94989 int iTab, /* A sorting index used to test for distinctness */
95249 ** KeyInfo structure is appropriate for initializing a virtual index to
95252 ** index to implement a DISTINCT test.
95526 int iCol = pExpr->iColumn; /* Index of column in pTab */
95755 int cnt; /* Index added to make the name unique */
97214 int iFrom, /* Index in p->pSrc->a[] of the inner subquery */
97652 ** INDEXED BY clause, then try to locate the specified index. If there
97653 ** was such a clause and the named index cannot be found, return
97661 Index *pIdx;
97667 sqlite3ErrorMsg(pParse, "no such index: %s", zIndex, 0);
97770 /* Locate the index named by the INDEXED BY clause, if any. */
98183 Index *pIdx /* Index used to optimize scan, or NULL */
98188 INDEX " : "",
98449 ** The second form is preferred as a single index (or temp-table) may be
98452 ** BY and DISTINCT, and an index or separate temp-table for the other.
98464 ** index might end up being unused if the data can be
98467 ** we figure out that the sorting index is not needed. The addrSortIndex
98498 /* Open a virtual index to use for the distinct set.
98520 /* If sorting index that was created by a prior OP_OpenEphemeral
98648 int addrSortingIdx; /* The OP_OpenEphemeral for the sorting index */
98652 /* If there is a GROUP BY clause we might need a sorting index to
98653 ** implement it. Allocate that sorting index now. If it turns out
98683 ** it might be a single loop that uses an index to extract information
98698 ** each row into a sorting index, terminate the first loop,
98699 ** then loop over the sorting index in order to get the output
98867 ** is better to execute the op on an index, as indexes are almost
98872 Index *pIdx; /* Iterator variable */
98873 KeyInfo *pKeyInfo = 0; /* Keyinfo for scanned index */
98874 Index *pBest = 0; /* Best index found so far */
98880 /* Search for the index that has the least amount of columns. If
98881 ** there is such an index, and it has less columns than the table
98884 ** In this case set iRoot to the root page number of the index b-tree
98886 ** index.
98888 ** (2011-04-15) Do not do a full scan of an unordered index.
98935 ** index or indices to use) should place a different priority on
98964 VdbeComment((v, "%s() by index",
99413 int iTabDb; /* Index of the database holding pTab */
99997 int iDb; /* Index of the database to use */
100395 ** with an index greater than 32 may be accessed, 0xffffffff is returned.
100541 Index *pIdx; /* For looping over indices */
100545 int *aRegIdx = 0; /* One register assigned to each index to be updated */
100546 int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the
100614 ** The index cursors might not be used, but if they are used they
100629 ** of the UPDATE statement. Also find the column index
100676 ** array for each index associated with table being updated. Fill in
100682 aRegIdx = sqlite3DbMallocRaw(db, sizeof(Index*) * nIdx );
100781 ** Open every index that needs updating. Note that if any
100782 ** index could potentially invoke a REPLACE conflict resolution
100854 ** table and index records, and as the values for any new.* references
100932 /* Delete the index entries associated with the current record. */
100946 /* Insert the new index entries and the new record. */
101334 "SELECT 'CREATE INDEX vacuum_db.' || substr(sql,14)"
101335 " FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ");
101338 "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) "
101339 " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
102785 #define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */
102791 #define WHERE_IDX_ONLY 0x00800000 /* Use index only - omit table */
102797 #define WHERE_TEMP_INDEX 0x20000000 /* Uses an ephemeral index */
102864 ** The index in pWC->a[] of the new WhereTerm is returned on success.
103038 ** IMPLEMENTATION-OF: R-59926-26393 To be usable by an index a term must be
103126 Index *pIdx /* Must be compatible with this index, if not NULL */
103149 /* Figure out the collation sequence required from an index for
103376 ** potentially be used with an index if an appropriate index exists.
103377 ** This analysis does not consider whether or not the index exists; that
103402 int idxTerm /* Index of the OR-term to be analyzed */
103518 int iColumn = -1; /* Column index on lhs of IN operator */
103650 ** and the copy has idxParent set to the index of the original term.
103655 int idxTerm /* Index of the term to be analyzed */
103658 WhereMaskSet *pMaskSet; /* Set of table index masks */
103694 extraRight = x-1; /* ON clause terms may not be used with an index
103754 ** skipped. Or, if the children are satisfied by an index, the original
103933 ** an index for tables to the left of the join.
103960 ** uses the same collation sequence as the iCol'th column of index pIdx.
103964 ** If such an expression is found, its index in pList->a[] is returned. If
103971 Index *pIdx, /* Index to match column of */
103972 int iCol /* Column of index to match */
103996 ** index for the outer loop guarantees that rows with equal values for
104003 ** can benefit from any index on columns "b" and "c".
104008 Index *pIdx, /* The index being considered */
104011 int nEqCol /* Number of index columns with == */
104023 ** same table as index pIdx, return early. Finally, if there is no
104055 ** UNIQUE index that guarantees that the result of the query will be distinct
104065 Index *pIdx;
104088 ** 1. The index is itself UNIQUE, and
104090 ** 2. All of the columns in the index are either part of the pDistinct
104093 index.
104106 /* This index implies that the DISTINCT qualifier is redundant. */
104121 ** the table has a cursor number of "base". pIdx is an index on pTab.
104127 ** All terms of the ORDER BY that match against the index must be either
104129 ** index do not need to satisfy this constraint.) The *pbRev value is
104136 Index *pIdx, /* The index we are testing */
104139 int nEqCol, /* Number of index columns with == constraints */
104140 int wsFlags, /* Index usages flags */
104144 int sortOrder = 0; /* XOR of index and ORDER BY sort direction */
104156 /* Argument pIdx must either point to a 'real' named index structure,
104157 ** or an index structure allocated on the stack by bestBtreeIndex() to
104158 ** represent the rowid index that is part of every table. */
104162 ** the index.
104166 ** of the index is also allowed to match against the ORDER BY
104173 int iColumn; /* The i-th column of the index. -1 for rowid */
104174 int iSortOrder; /* 1 for DESC, 0 for ASC on the i-th index term */
104175 const char *zColl; /* Name of the collating sequence for i-th index term */
104179 /* Can not use an index sort on anything that is not a column in the
104200 /* Term j of the ORDER BY clause does not match column i of the index */
104202 /* If an index column that is constrained by == fails to match an
104203 ** ORDER BY term, that is OK. Just ignore that column of the index
104207 /* Index column i is the rowid. All other terms match. */
104210 /* If an index column fails to match and is not constrained by ==
104211 ** then the index cannot satisfy the ORDER BY constraint.
104234 ** tables in the join, then we are assured that the index can be used
104244 /* All terms of the ORDER BY clause are covered by this index so
104245 ** this index can be used for sorting. */
104251 /* All terms of this index match some prefix of the ORDER BY clause
104252 ** and the index is UNIQUE and no terms on the tail of the ORDER BY
104256 ** even on a UNIQUE index, so disallow those cases. */
104377 WHERETRACE(("... Multi-index OR testing for term %d of %d....\n",
104413 WHERETRACE(("... multi-index OR cost=%.9g nrow=%.9g\n", rTotal, nRow));
104429 ** could be used with an index to access pSrc, assuming an appropriate
104430 ** index existed.
104451 ** possible to construct a transient index that would perform better
104452 ** than a full table scan even when the cost of constructing the index
104454 ** transient index.
104465 double costTempIdx; /* per-query cost of the transient index */
104471 /* There is no point in building an automatic index for a single scan */
104479 /* We already have some kind of index in use for this query. */
104506 WHERETRACE(("auto-index reduces cost from %.1f to %.1f\n",
104523 ** Generate code to construct the Index object for an automatic index
104525 ** makes use of the automatic index.
104530 struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
104532 WhereLevel *pLevel /* Write new index here */
104534 int nColumn; /* Number of columns in the constructed index */
104538 Index *pIdx; /* Object describing the transient index */
104542 KeyInfo *pKeyinfo; /* Key information for the index */
104543 int addrTop; /* Top of the index fill loop */
104544 int regRecord; /* Register holding an index record */
104553 ** transient index on 2nd and subsequent iterations of the loop. */
104558 /* Count the number of columns that will be added to the index
104580 ** covering index. A "covering index" is an index that contains all
104581 ** columns that are needed by the query. With a covering index, the
104583 ** be a covering index because the index will not be updated if the
104584 ** original table changes and the index and table cannot both be used
104599 /* Construct the Index object to describe this index */
104600 nByte = sizeof(Index);
104601 nByte += nColumn*sizeof(int); /* Index.aiColumn */
104602 nByte += nColumn*sizeof(char*); /* Index.azColl */
104603 nByte += nColumn; /* Index.aSortOrder */
104610 pIdx->zName = "auto-index";
104631 /* Add additional columns needed to make the automatic index into
104632 ** a covering index */
104649 /* Create the automatic index */
104656 /* Fill the automatic index with content */
104693 WHERETRACE(("Recomputing index info for %s...\n", pSrc->pTab->zName));
104827 ** Compute the best index for a virtual table.
104829 ** The best index is computed by the xBestIndex method of the virtual
104846 Bitmask notReady, /* Mask of cursors not available for index */
104850 sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */
104908 ** even though we might try to pick the best index multiple times.
104909 ** For each attempt at picking an index, the order of tables in the
104946 /* If there is an ORDER BY clause, and the selected virtual table index
104984 ** index. Store the results in aStat as follows:
104993 Index *pIdx, /* Index to consider domain of */
105180 ** by scanning an index for a range of values. The range may have an upper
105183 ** example, assuming that index p is on t1(a):
105193 ** The nEq parameter is passed the index of the index column subject to the
105195 ** optimized by the proposed index scan. For example, assuming index p is
105201 ** b, is the second left-most column of the index). Or, if the query is:
105219 Index *p, /* The index containing the range-compared column; "x" */
105220 int nEq, /* index into p->aCol[] of the range-compared column */
105288 ** column of an index and sqlite_stat3 histogram data is available
105289 ** for that index. When pExpr==NULL that means the constraint is
105303 Index *p, /* The index whose left-most column is pTerm */
105352 Index *p, /* The index whose left-most column is pTerm */
105392 ** index and in the main table.
105396 ** named index. If no such plan is found, then the returned cost is
105397 ** SQLITE_BIG_DBL. If a plan is found that uses the named index,
105403 ** index.
105416 Index *pProbe; /* An index we are evaluating */
105417 Index *pIdx; /* Copy of pProbe, or zero for IPK index */
105419 int idxEqTermMask; /* Index mask of valid equality operators */
105420 Index sPk; /* A fake index object for the primary key */
105421 tRowcnt aiRowEstPk[2]; /* The aiRowEst[] value for the sPk index */
105422 int aiColumnPk = -1; /* The aColumn[] value for the sPk index */
105430 ** use an index to satisfy IS NULL constraints on that table. This is
105432 ** a circumstance which the index cannot help us discover. Ticket #2177.
105441 /* An INDEXED BY clause specifies a particular index to use */
105446 /* There is no INDEXED BY clause. Create a fake Index object in local
105447 ** variable sPk to represent the rowid primary key index. Make this
105448 ** fake index the first in a chain of Index objects with all of the real
105450 Index *pFirst; /* First of real indices on the table */
105451 memset(&sPk, 0, sizeof(Index));
105485 ** index being evaluated. They are then used to determine the expected
105489 ** Number of equality terms that can be implemented using the index.
105490 ** In other words, the number of initial fields in the index that
105495 ** SQLite must perform on the index in question. For example, if the
105500 ** SQLite must perform 9 lookups on an index on (a, b), so nInMul is
105528 ** external sort (i.e. scanning the index being evaluated will not
105532 ** Boolean. True if a table lookup is required for each index entry
105533 ** visited. In other words, true if this is not a covering index.
105534 ** This is always false for the rowid primary key index of a table.
105536 ** used by the SELECT statement are present in the index (such an
105537 ** index is sometimes described as a covering index).
105538 ** For example, given the index on (a, b), the second of the following
105541 ** both available in the index.
105546 int nEq; /* Number of == or IN terms matching index */
105552 int bDist = !!pDistinct; /* True if index cannot help with DISTINCT */
105553 int bLookup = 0; /* True if not a covering index */
105556 WhereTerm *pFirstTerm = 0; /* First term matching the index */
105586 /* If the index being considered is UNIQUE, and there is an equality
105587 ** constraint for all columns in the index, then this search will find
105593 ** optimized using the index.
105623 /* If there is an ORDER BY clause and the index being considered will
105625 ** in wsFlags. Otherwise, if there is an ORDER BY clause but the index
105635 /* If there is a DISTINCT qualifier and this index will scan rows in
105645 /* If currently calculating the cost of using an index (not the IPK
105646 ** index), determine if all required column data may be obtained without
105647 ** using the main table (i.e. if the index is a covering
105648 ** index for this query). If it is, set the WHERE_IDX_ONLY flag in
105703 ** to do a binary search to locate a row in a table or index is roughly
105705 ** a table or index. The actual times can vary, with the size of
105711 ** not give us data on the relative sizes of table and index records.
105713 ** as index records
105720 ** the cost function to err on the side of choosing an index over
105731 /* For an index lookup followed by a table lookup:
105732 ** nInMul index searches to find the start of each index range
105733 ** + nRow steps through the index
105738 /* For a covering index:
105739 ** nInMul index searches to find the initial entry
105740 ** + nRow steps through the index
105766 /**** Cost of using this index has now been computed ****/
105769 ** be used with the current index, but which might lower the number
105771 ** matters if the current index is the least costly, so do not bother
105772 ** with this step if we already know this index will not be chosen.
105776 ** the notReady mask. When computing an "optimal" index, the notReady
105780 ** of notValid, then a optimal index that depends on inner joins loops
105781 ** might be selected even when there exists an optimal index that has
105796 /* Ignore the first nEq equality matches since the index
105806 /* Ignore the first nSkipRange range constraints since the index
105835 /* If this index is the best we have seen so far, then record this
105836 ** index and its cost in the pCost structure.
105849 /* If there was an INDEXED BY clause, then only that one index is
105853 /* Reset masks for the next index in the loop */
105859 ** is set, then reverse the order that the index will be scanned
105874 WHERETRACE(("best index is: %s\n",
106062 ** index.
106064 ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c).
106066 ** The index has as many as three equality constraints, but in this
106070 ** in consecutive registers and the index of the first register is returned.
106078 ** the index of that memory cell. The code that
106085 ** copy of the column affinity string of the index allocated using
106093 ** In the example above, the index on t1(a) has TEXT affinity. But since
106096 ** a key to search the index. Hence the first byte in the returned affinity
106109 Index *pIdx; /* The index being used for this loop */
106117 /* This module is only called on query plans that use an index. */
106141 ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */
106183 int iTerm, /* Index of this term. First is zero */
106203 ** is run and there is an index on (a, b), then this function returns a
106214 Index *pIndex = pPlan->u.pIdx;
106310 zMsg = sqlite3MAppendf(db, zMsg, "%s VIRTUAL TABLE INDEX %d:%s", zMsg,
106342 int omitTable; /* True if we use the index only */
106530 /* Case 3: A scan using an index.
106534 ** left-most columns of the index. It may also contain
106539 ** index is on (x,y,z), then the following clauses are all
106558 ** constraints but an index is selected anyway, in order
106586 Index *pIdx; /* The index we will be using */
106587 int iIdxCur; /* The VDBE cursor for the index */
106602 ** the first one after the nEq equality constraints in the index,
106637 /* If we are doing a reverse order scan on an ascending index, or
106638 ** a forward order scan on a descending index, interchange the
106655 index cursor to the start of the range. */
106725 /* Check if the index cursor is past the end of the range. */
106759 ** WHERE clause terms made redundant by the index range scan.
106778 ** CREATE INDEX i1 ON t1(a);
106779 ** CREATE INDEX i2 ON t1(b);
106780 ** CREATE INDEX i3 ON t1(c);
106950 /* Case 5: There is no usable index. We must do a complete
107046 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
107138 ** If an index can be used so that the natural output order of the table
107139 ** scan is correct for the ORDER BY clause, then that index is used and
107141 ** unnecessary sort of the result set if an index appropriate for the
107293 /* Chose the best index to use for each table in the FROM clause.
107297 ** pWInfo->a[].pIdx The index to use for this level of the loop.
107302 ** pWInfo->a[].iIdxCur The VDBE cursor for the index
107313 Index *pIdx; /* Index for FROM table at pTabItem */
107319 Bitmask notIndexed; /* Mask of tables that cannot use an index */
107374 WhereCost sCost; /* Cost information from best[Virtual]Index() */
107375 ExprList *pOrderBy; /* ORDER BY clause for index to optimize */
107376 ExprList *pDist; /* DISTINCT clause for index to optimize */
107407 ** index if it uses any index at all */
107426 ** index specified by its INDEXED BY clause. This rule ensures
107484 ** INDEXED BY clause attached to it, that the named index is being
107491 sqlite3ErrorMsg(pParse, "cannot use index: %s", pIdx->zName);
107495 ** guaranteed to find the index specified in the INDEXED BY clause
107496 ** if it find an index at all. */
107532 int iDb; /* Index of database containing table/index */
107572 Index *pIx = pLevel->plan.u.pIdx;
107601 ** and the index used to access it (if any). If the table itself
107602 ** is not used, its name is just '{}'. If no index is used
107603 ** the index is listed as "{}". If the primary key is used the
107604 ** index name is '*'.
107741 /* If this scan uses an index, make code substitutions to read data
107742 ** from the index in preference to the table. Sometimes, this means
107746 ** position in the index.
107752 ** reference the index.
107757 Index *pIdx = pLevel->plan.u.pIdx;
108059 ** If the index value yy_shift_ofst[S]+X is out of range or if the value
108659 int yyidx; /* Index of top element in stack */
108744 "THEN", "ELSE", "INDEX", "ALTER",
109022 /* 242 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
109031 /* 251 */ "cmd ::= DROP INDEX ifexists fullname",
110721 case 242: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
110744 sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
110757 sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
110764 case 251: /* cmd ::= DROP INDEX ifexists fullname */
111470 testcase( i==2 ); /* INDEX */
113356 /* SQLITE_RANGE */ "bind or column index out of range",
113889 int iDb = SQLITE_MAX_ATTACHED; /* sqlite3.aDb[] index of db to checkpoint */
114237 ** If an invalid limit index is supplied, report -1.
114328 int iIn; /* Input character index */
114329 int iOut = 0; /* Output character index */
115851 /* The full-text index is stored in a series of b+tree (-like)
115889 ** A position is the index of a word within the document. The first
115904 ** varint column; (index of new column)
115913 ** memory. A "position" is an index of a token in the token stream
116044 ** idx - index within level
116106 ** index into the term index, we clearly cannot simply update the term
116107 ** index when a document is deleted or updated. For deletions, we
116270 ** *piEndOffset. *piStartOffset should be set to the index of the first
116272 ** to the index of the first byte just past the end of the token in
116473 ** FTS4 virtual tables may maintain multiple indexes - one index of all terms
116477 ** It is possible to determine which index a b+-tree belongs to based on the
116478 ** value stored in the "%_segdir.level" column. Given this value L, the index
116480 ** level values between 0 and 1023 (inclusive) belong to index 0, all levels
116481 ** between 1024 and 2047 to index 1, and so on.
116483 ** It is considered impossible for an index to use more than 1024 levels. In
116575 ** A connection to a fulltext index is an instance of the following
116610 ** The following array of hash tables is used to buffer pending index
116617 ** A single FTS4 table may have multiple full-text indexes. For each index
116618 ** there is an entry in the aIndex[] array. Index 0 is an index of all the
116619 ** terms that appear in the document set. Each subsequent index in aIndex[]
116620 ** is an index of prefixes of a specific length.
116624 int nPrefix; /* Prefix length (0 for main terms index) */
116625 Fts3Hash hPending; /* Pending terms table for this index */
116680 ** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index
116694 #define FTS3_FULLTEXT_SEARCH 2 /* Full-text index search */
116737 int iColumn; /* Index of column this phrase must match */
117027 int iIn = 1; /* Index of next byte to read from input */
117028 int iOut = 0; /* Index of next byte to write to output */
117526 ** always maintain the main "terms" index, but may also maintain one or
117688 int iCol; /* Column index */
118031 int iCons = -1; /* Index of constraint to use */
118032 int iLangidCons = -1; /* Index of langid=x constraint, if present */
118188 ** table is missing a row that is present in the full-text index.
118552 int iCol1; /* The current column index in pp1 */
118553 int iCol2; /* The current column index in pp2 */
118572 ** for the same column (the column with index iCol1 and iCol2).
119236 int iIndex, /* Index to search (from 0 to p->nIndex-1) */
119304 ** Set up a cursor object for iterating through a full-text index or a
119310 int iIndex, /* Index to search (from 0 to p->nIndex-1) */
119382 int bFound = 0; /* True once an index has been found */
119547 ** If idxNum>=FTS3_FULLTEXT_SEARCH then use the full text index. The
119554 int idxNum, /* Strategy index */
119679 int iCol /* Index of column to read value from */
119927 sqlite3_result_text(pContext, "Index optimized", -1, SQLITE_STATIC);
119930 sqlite3_result_text(pContext, "Index already optimal", -1, SQLITE_STATIC);
120848 ** table actually contains the same data as the index. To prevent this from
120873 ** to retrieve the entire doclist for the token from the full-text index.
122144 int idxNum, /* Strategy index */
122214 int iCol /* Index of column to read value from */
123052 ** The iDefaultCol parameter should be passed the index of the table column
123734 int iToken; /* index of next token to be returned */
124866 int iToken; /* index of next token to be returned */
125085 ** When full-text index nodes are loaded from disk, the buffer that they
125087 ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer
125156 ** terms when querying the full-text index. See functions:
125169 int iIdx; /* Index within level, or 0x7FFFFFFF for PT */
125442 int eStmt, /* Index of statement to evaluate */
125496 ** Within each language id, a separate index is maintained to store the
125498 ** "prefix=" option). And each index consists of multiple levels ("relative
125501 ** All three of these values (the language id, the specific index and the
125502 ** level within the index) are encoded in 64-bit integer values stored
125507 ** Specifically, each language-id/index combination is allocated 1024
125508 ** 64-bit integer level values ("absolute levels"). The main terms index
125509 ** for language-id 0 is allocate values 0-1023. The first prefix index
125514 ** absolute levels that corresponds to language-id iLangid and index
125553 int iIndex, /* Index for p->aIndex[] */
125793 /* Add the term to the terms index */
126008 ** full-text index.
126051 ** This function allocates a new level iLevel index in the segdir table.
126053 ** with 0, so the allocated index is one greater than the value returned
126060 ** allocated index is 0.
126062 ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK
126068 int iIndex, /* Index for p->aIndex */
126079 /* Set variable iNext to the next available segdir index at level iLevel. */
126094 ** segment and allocate (newly freed) index 0 at level iLevel. Otherwise,
126095 ** if iNext is less than FTS3_MERGE_COUNT, allocate index iNext.
126609 int iIndex, /* Index for p->aIndex */
126658 ** the index. All that is required is a straight hash-lookup.
127314 ** Set *pnMax to the largest segment level in the database for the index
127366 int iIndex, /* Index for p->aIndex */
127875 int iIndex, /* Index in p->aIndex[] to merge */
127879 int iIdx = 0; /* Index of new segment */
127880 sqlite3_int64 iNewLevel = 0; /* Level/index to create new segment at */
127900 ** index. The idx of the new segment is always 0. */
127913 ** available segment index at level iLevel+1. The call to
128154 ** The entire FTS index is discarded and rebuilt. If the table is one
128155 ** created using the content=xxx option, then the new index is based on
128686 int iPos; /* Index of first token in snippet */
129011 int iCol, /* Index of column to create snippet from */
129358 ** file system. This is done because the full-text index doclist is required
129359 ** to calculate these values properly, and the full-text index doclist is
130326 int iCell; /* Index of current cell in pNode */
130352 int iCoord; /* Index of constrained coordinate */
130681 ** Remove cell the cell with index iCell from node pNode.
131162 ** integer value equal to iRowid. Return the index of this cell.
131182 ** Return the index of the cell containing a pointer to node pNode
132531 ** Delete the cell at index iCell of node pNode. After removing the
132752 int iCell; /* Index of iDelete cell in pLeaf */
133475 int iPattern = 0; /* Current byte index in zPattern */
133476 int iString = 0; /* Current byte index in zString */