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
28680 ** When multiple threads all reference the same wal-index, each thread
28682 ** of this unixShmNode object. In other words, each wal-index is opened
29076 ** Check to see if it has been allocated (i.e. if the wal-index file is
34892 sqlite3_int64 sz; /* Current size of wal-index file */
34897 ** Check to see if it has been allocated (i.e. if the wal-index file is
35917 u32 iSize; /* Maximum bit index. Max iSize is 4,294,967,296. */
38444 ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
38887 Pgno iSubRec; /* Index of first record in sub-journal */
44646 ** index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes
44661 ** In any case, all savepoints with an index greater than iSavepoint
44792 ** has been removed (CREATE INDEX needs to move a page when a statement
45189 ** lock on the database file and use heap-memory to store the wal-index
45199 ** heap-memory for the wal-index instead of the VFS shared-memory
45455 ** To start a read transaction, the reader records the index of the last
45469 ** data structure called the wal-index is maintained to expedite the
45472 ** WAL-INDEX FORMAT
45474 ** Conceptually, the wal-index is shared memory, though VFS implementations
45475 ** might choose to implement the wal-index using a mmapped file. Because
45476 ** the wal-index is shared memory, SQLite does not support journal_mode=WAL
45480 ** The wal-index is transient. After a crash, the wal-index can (and should
45482 ** to either truncate or zero the header of the wal-index when the last
45483 ** connection to it closes. Because the wal-index is transient, it can
45486 ** as big endian, the wal-index can store multi-byte values in the native
45489 ** The purpose of the wal-index is to answer this question quickly: Given
45490 ** a page number P, return the index of the last frame for page P in the WAL,
45493 ** The wal-index consists of a header region, followed by an one or
45494 ** more index blocks.
45496 ** The wal-index header contains the total number of frames within the WAL
45499 ** Each index block except for the first contains information on
45500 ** HASHTABLE_NPAGE frames. The first index block contains information on
45502 ** HASHTABLE_NPAGE are selected so that together the wal-index header and
45503 ** first index block are the same size as all other index blocks in the
45504 ** wal-index.
45506 ** Each index block contains two sections, a page-mapping that contains the
45508 ** that allows readers to query an index block for a specific page number.
45510 ** for the first index block) 32-bit page numbers. The first entry in the
45511 ** first index-block contains the database page number corresponding to the
45512 ** first frame in the WAL file. The first entry in the second index block
45516 ** The last index block in a wal-index usually contains less than the full
45523 ** can be found by scanning the page-mapping sections of each index block
45524 ** starting with the last index block and moving toward the first, and
45525 ** within each index block, starting at the end and moving toward the
45534 ** 1-based index of an entry in the mapping section of the same
45535 ** index block. Let K be the 1-based index of the largest entry in
45536 ** the mapping section. (For index blocks other than the last, K will
45537 ** always be exactly HASHTABLE_NPAGE (4096) and for the last index block
45549 ** be at index iUnused. (iUnused might be less than iKey if there was
45555 ** current index block. Otherwise the iMax-th mapping entry of the
45556 ** current index block corresponds to the last entry that references
45559 ** A hash search begins with the last index block and moves toward the
45560 ** first index block, looking for entries corresponding to page P. On
45561 ** average, only two or three slots in each index block need to be
45563 ** establish that no such entry exists in the block. Each index block
45564 ** holds over 4000 entries. So two or three index blocks are sufficient
45573 ** and to the wal-index) might be using a different value K1, where K1>K0.
45601 ** The maximum (and only) versions of the wal and wal-index formats
45608 ** Similarly, if a client successfully reads a wal-index header (i.e. the
45635 ** The following object holds a copy of the wal-index header content.
45637 ** The actual header in the wal-index consists of two copies of this
45645 u32 iVersion; /* Wal-index version */
45651 u32 mxFrame; /* Index of last valid frame in the WAL */
45659 ** A copy of the following object occurs in the wal-index immediately
45762 volatile u32 **apWiData; /* Pointer to wal-index content in memory */
45773 WalIndexHdr hdr; /* Wal-index header for current transaction */
45796 ** Each page of the wal-index mapping contains a hash-table made up of
45806 ** the largest index).
45825 } aSegment[1]; /* One for every 32KB page in the wal-index */
45829 ** Define the parameters of the hash tables in the wal-index file. There
45831 ** wal-index.
45833 ** Changing any of these constants will alter the wal-index format and
45842 ** wal-index is smaller than usual. This is so that there is a complete
45843 ** hash-table on each aligned 32KB page of the wal-index.
45847 /* The wal-index is divided into pages of WALINDEX_PGSZ bytes each. */
45853 ** Obtain a pointer to the iPage'th page of the wal-index. The wal-index
45854 ** is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are
45857 ** If this call is successful, *ppPage is set to point to the wal-index
45901 ** Return a pointer to the WalCkptInfo structure in the wal-index.
45909 ** Return a pointer to the WalIndexHdr structure in the wal-index.
45982 ** Write the header information in pWal->hdr into the wal-index.
46168 ** page iHash of the wal-index. The wal-index is broken into 32KB pages
46172 ** in the wal-index file. Set *piZero to one less than the frame
46183 volatile ht_slot **paHash, /* OUT: Pointer to hash index */
46213 ** Return the number of the wal-index page that contains the hash-table
46215 ** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
46311 ** Set an entry in the wal-index that will map database page number
46322 /* Assuming the wal-index file was successfully mapped, populate the
46394 ** Recover the wal-index by reading the write-ahead log file.
46397 ** wal-index to prevent other threads/processes from doing anything
46398 ** with the WAL or wal-index while recovery is running. The
46440 int iFrame; /* Index of last frame read */
46565 ** Close an open wal-index.
46586 ** client from unlinking the WAL or wal-index file. If another process
46595 sqlite3_vfs *pVfs, /* vfs module to open wal and wal-index */
46671 ** same WalIterator object. Write into *piFrame the frame index where
46681 u32 *piFrame /* OUT: Wal frame index of next page */
46719 ** of indices such that the aRight[] contains every index that appears in
46729 ** When that happens, omit the aLeft[X] and use the aRight[Y] index.
46739 int iLeft = 0; /* Current index in aLeft */
46740 int iRight = 0; /* Current index in aRight */
46741 int iOut = 0; /* Current index in output buffer */
46802 int iList; /* Index into input list */
46803 int iSub = 0; /* Index into aSub array */
46909 ht_slot *aIndex; /* Sorted index for this segment */
46960 ** The cache of the wal-index header must be valid to call this function.
46989 ** This routine uses and updates the nBackfill field of the wal-index header.
47032 /* Compute in mxSafeFrame the index of the last frame of the WAL that is
47170 int isDelete = 0; /* True to unlink wal and wal-index files */
47176 ** the wal and wal-index files.
47225 ** Try to read the wal-index header. Return 0 on success and 1 if
47228 ** The wal-index is in shared memory. Another thread or process might
47246 /* The first page of the wal-index must be mapped at this point. */
47254 ** There are two copies of the header at the beginning of the wal-index.
47288 ** Read the wal-index header from the wal-index and into pWal->hdr.
47290 ** wal-index from the WAL before returning.
47292 ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is
47296 ** If the wal-index header is successfully read, return SQLITE_OK.
47302 volatile u32 *page0; /* Chunk of wal-index containing header */
47304 /* Ensure that page 0 of the wal-index (the page that contains the
47305 ** wal-index header) is mapped. Return early if an error occurs here.
47314 /* If the first page of the wal-index has been mapped, try to read the
47315 ** wal-index header immediately, without holding any lock. This usually
47316 ** works, but may fail if the wal-index header is corrupt or currently
47336 /* If the wal-index header is still malformed even while holding
47350 ** sure the wal-index was not constructed with some future format that
47378 ** to make a copy of the wal-index header into pWal->hdr. If the
47379 ** wal-index header has changed, *pChanged is set to 1 (as an indication
47381 ** flushed.) When useWal==1, the wal-index header is assumed to already
47392 ** bad luck when there is lots of contention for the wal-index, but that
47417 volatile WalCkptInfo *pInfo; /* Checkpoint information in wal-index */
47419 int mxI; /* Index of largest aReadMark[] value */
47558 ** value in the aReadMark[] array or the contents of the wal-index
47561 ** It is necessary to check that the wal-index header did not change
47571 ** This does not guarantee that the copy of the wal-index header is up to
47595 ** it takes a snapshot of the state of the WAL and wal-index for the current
47597 ** Other threads might append new content to the WAL and wal-index but
47653 /* If the "last page" field of the wal-index header snapshot is 0, then
47669 ** that adds entries to the wal-index (and possibly to this hash
47693 int iKey; /* Hash slot index */
47716 ** of the wal-index file content. Make sure the results agree with the
47840 /* Restore the clients cache of the wal-index header to the state it
47942 ** wal-index header to reflect this.
47945 ** at this point. But updating the actual wal-index header is also
48198 /* Append data to the wal-index. It is not necessary to lock the
48199 ** wal-index to do this as the SQLITE_SHM_WRITE lock held on the wal-index
48224 /* If this is a commit, update the wal-index header too. */
48257 int isChanged = 0; /* True if a new wal-index header is loaded */
48293 /* Read the wal-index header. */
48314 /* If a new wal-index header was loaded before the checkpoint was
48316 ** out of date. So zero the cached wal-index header to ensure that
48408 ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
48485 ** BTrees. Each BTree is identified by the index of its root page. The
48673 ** plus 2 bytes for the index to the cell in the page header). Such
48731 u16 cellOffset; /* Index in aData of first cell pointer */
48741 u8 *aCellIdx; /* The cell index area */
48930 ** The entry is identified by its MemPage and the index in
48961 i16 iPage; /* Index of current page in apPage */
48962 u16 aiIdx[BTCURSOR_MAX_DEPTH]; /* Current index in apPage[i] */
49485 ** When writing to an index that resides in a sharable database, the
49489 ** the table corresponding to the index being written, this
49492 ** Instead of a lock on the table/index rooted at page iRoot, the caller may
49499 int isIndex, /* True if iRoot is the root of an index b-tree */
49516 /* If the client is reading or writing an index and the schema is
49527 ** written. For index b-trees, it is the root page of the associated
49532 Index *pIdx = (Index *)sqliteHashData(p);
49563 ** table or index rooted at iRoot because other shared connections are
49564 ** simultaneously reading that same table or index.
49572 ** For example, before writing to any part of the table or index
50018 ** In this version of BtreeMoveto, pKey is a packed index record
50024 const void *pKey, /* Packed key if the btree is an index */
50030 UnpackedRecord *pIdxKey; /* Unpacked index key */
50192 int iPtrmap; /* Pointer map page index */
50228 ** Given a btree page and a cell index (0 means the first cell on
50262 ** cell index as the second argument and btreeParseCellPtr()
50338 int iCell, /* The cell index. First cell is 0 */
50448 int iCellFirst; /* First allowable cell index */
50449 int iCellLast; /* Last possible cell index */
50516 ** as the first argument. Write into *pIdx the index into pPage->aData[]
50805 int i; /* Index into the cell pointer array */
52309 Pgno iFreePg; /* Index of free page to move pLastPg to */
52754 ** an index greater than all savepoints created explicitly using
53583 ** pCur->idx is set to the cell index that contains the pointer
53586 ** the largest cell index.
53632 ** structure the flags byte is set to 0x02 or 0x0A, indicating an index
53671 ** expected to open it on an index b-tree. Otherwise, if pKeyInfo is
53826 ** must be NULL. For index tables, pIdxKey is used and intKey
53852 UnpackedRecord *pIdxKey, /* Unpacked index key */
53902 ** be the right kind (index or table) of b-tree page. Otherwise
53938 ** the maximum number of record bytes stored on an index B-Tree
54248 /* Decrement the free-list count by 1. Set iTrunk to the index of the
54887 ** Insert a new cell on pPage at cell index "i". pCell points to the
54894 ** in pTemp or the original pCell) and also record its index.
54915 int ins; /* Index in data[] where new cell pointer is inserted */
55296 int iParentIdx, /* Index of "the page" in pParent */
55321 int cntNew[NB+2]; /* Index in aCell[] of cell after i-th page */
55338 ** index iParentIdx. This scenario comes about when this function
55532 ** size of all cells on the i-th page and cntNew[] which is the index
55540 ** cntNew[i]: Index in apCell[] and szCell[] for the first cell to
55575 int r; /* Index of right-most cell in left sibling */
55576 int d; /* Index of first cell to the left of right sibling */
56161 ** expecting an index b-tree, then the caller should be inserting blob
56281 int iCellIdx; /* Index of cell to delete */
56840 int iIdx; /* Index of child node in parent */
56855 ** pCur->aiIdx[pCur->iPage] value is set to the index of the parent cell
58914 ** empty boolean index.
61236 int idx, /* Index of column zName applies to */
62059 ** data and index records. Each serialized value consists of a
62063 ** In an SQLite index record, the serial type is stored directly before
62446 ** This function compares the two table rows or index records
62561 ** pCur points at an index entry created using the OP_MakeRecord opcode.
62578 /* Get the size of the index entry. Only indices entries of less
62588 /* Read in the complete content of the index entry */
62595 /* The index entry must begin with a header size */
62603 /* The last field of the index should be an integer - the ROWID.
62623 /* Fetch the integer off the end of the index record */
62638 ** Compare the key of the index entry that cursor pC is pointing to against
62644 ** omits the rowid at the end. The rowid at the end of the index entry
63792 int i, /* Index of the parameter to bind */
63937 ** Return the name of a wildcard parameter. Return NULL if the index
63951 ** Given a wildcard parameter name, return the index of the variable
64135 ** the host parameter index is found by scanning the perpared
64137 ** parameter index is known, locate the value in p->aVar[]. Then render
64145 int idx = 0; /* Index of a host parameter */
64146 int nextIndex = 1; /* Index of next ? host parameter */
64536 int iCur, /* Index of the new VdbeCursor */
64537 int nField, /* Number of fields in the table or index */
65097 u8 *zIdx; /* Index into header */
65207 UnpackedRecord r; /* B-Tree index search key */
65603 ** the one at index P2 from the beginning of
67030 u8 *zIdx; /* Index into header */
67339 ** in an index. The OP_Column opcode can decode the record later.
67343 ** field of the index key.
67348 ** If P4 is NULL then all index fields have the affinity NONE.
67471 ** Store the number of entries (an integer value) in the table or index
67741 ** P1 is the index of the database file on which the transaction is
67742 ** started. Index 0 is the main database file and index 1 is the
67863 /* See note about index shifting on OP_ReadCookie */
67968 ** sequence of the index being opened. Otherwise, if P4 is an integer
67975 ** Open a read/write cursor named P1 on the table or index whose root
67982 ** sequence of the index being opened. Otherwise, if P4 is an integer
67984 ** largest index of any column of the table that is actually used.
68081 ** The cursor points to a BTree table if P4==0 and to a BTree index
68083 ** that defines the format of keys in the index.
68125 /* If a transient index is required, create it by calling
68155 ** a transient index that is specifically designed to sort large
68222 ** to an SQL index, then P3 is the first in an array of P4 registers
68223 ** that are used as an unpacked index key.
68235 ** to an SQL index, then P3 is the first in an array of P4 registers
68236 ** that are used as an unpacked index key.
68248 ** to an SQL index, then P3 is the first in an array of P4 registers
68249 ** that are used as an unpacked index key.
68261 ** to an SQL index, then P3 is the first in an array of P4 registers
68262 ** that are used as an unpacked index key.
68459 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
68469 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
68542 ** Cursor P1 is open on an index b-tree - that is to say, a btree which
68544 ** the list field being the integer ROWID of the entry that the index
68549 ** that make up an unpacked index key that can be used with cursor P1.
68551 ** value appended to the end of the index record. This rowid value may
68559 ** of the index entry is not R. If there is no such entry, control jumps
68560 ** to instruction P2. Otherwise, the rowid of the conflicting index
68573 UnpackedRecord r; /* B-Tree index search key */
68584 /* Find the index cursor. */
68603 /* Populate the index search key. */
68616 /* Search the B-Tree index. If no conflicting record is found, jump
68639 ** P1 is an index.
69246 ** will refer to the last entry in the database table or index.
69247 ** If the table or index is empty and P2>0, then jump immediately to P2.
69248 ** If P2 is 0 or if the table or index is not empty, fall through
69282 ** Sorting is accomplished by writing records into a sorting index,
69283 ** then rewinding that index and playing it back from beginning to
69304 ** will refer to the first entry in the database table or index.
69305 ** If the table or index is empty and P2>0, then jump immediately to P2.
69306 ** If P2 is 0 or if the table or index is not empty, fall through
69343 ** table or index. If there are no more key/value pairs then fall through
69360 ** table or index. If there is no previous key/value pairs then fall through
69417 ** Register P2 holds an SQL index key made using the
69419 ** into the index P1. Data for the entry is nil.
69469 ** an unpacked index key. This opcode removes that entry from the
69470 ** index opened by cursor P1.
69507 ** the end of the index key pointed to by cursor P1. This integer should be
69508 ** the rowid of the table entry to which this index entry points.
69543 ** The P4 register values beginning with P3 form an unpacked index
69544 ** key that omits the ROWID. Compare this key value against the index
69545 ** that P1 is currently pointing to, ignoring the ROWID on the P1 index.
69547 ** If the P1 index entry is greater than or equal to the key value
69557 ** The P4 register values beginning with P3 form an unpacked index
69558 ** key that omits the ROWID. Compare this key value against the index
69559 ** that P1 is currently pointing to, ignoring the ROWID on the P1 index.
69561 ** If the P1 index entry is less than the key value then jump to P2.
69610 ** Delete an entire database table or index whose root page in the database
69670 ** Delete all contents of the database table or index whose root page
69672 ** remove the table or index from the database file.
69679 ** intkey table (an SQL table, not an index). In this case the row change
69714 ** The difference between a table and an index is this: A table must
69715 ** have a 4-byte integer key and can have arbitrary data. An index
69722 ** Allocate a new index in the main database file if P1==0 or in the
69814 ** of that table into the internal index hash table. This will cause
69839 ** the index named P4 in database P1. This is called after an index
69927 ** Insert the integer value held by register P2 into a boolean index
69946 ** Extract the smallest value from boolean index P1 and put that value into
69947 ** register P3. Or, if boolean index P1 is initially empty, leave P3
69959 /* The boolean index is empty */
69963 /* A value was pulled from the index */
70597 ** P1 is the index of the database in sqlite3.aDb[] of the database
70754 /* Grab the index number and argc parameters */
71302 int iCol; /* Index of zColumn in row-record */
71402 Index *pIdx;
71670 ** example, by CREATE INDEX statements on tables too large to fit in main
71705 ** aTree element is set to the index of it.
71709 ** values), it doesn't matter which index is stored.
71712 ** above contains the index of the smallest of each block of 4 iterators.
71713 ** And so on. So that aTree[1] contains the index of the iterator that
71992 ** multiple b-tree segments. Parameter iOut is the index of the aTree[]
72038 ** Initialize the temporary index cursor just opened as a sorter cursor.
72377 int iNew; /* Index of new, merged, PMA */
72454 int iPrev = pSorter->aTree[1];/* Index of iterator to advance */
72455 int i; /* Index of aTree[] to recalculate */
73302 ** pExpr->iDb Set the index in db->aDb[] of the database X
73832 ** ORDER BY term is not an integer index into the result set. That
73836 ** SELECT statement. Return the index i of the matching column,
73875 ** in the result set. Return an 1-based index of the matching
73894 int i, /* The index (1-based) of the term out of range */
74309 ** Expr.iColumn The column index in X.Y. -1 for the rowid.
74580 ** if the index with affinity idx_affinity may be used to implement
75797 ** The index of the cursor opened on the b-tree (database table, database index
75802 ** IN_INDEX_INDEX - The cursor was opened on a database index.
75815 ** has a UNIQUE constraint or UNIQUE index.
75819 ** be used unless <column> is an INTEGER PRIMARY KEY or an index can
75855 /* Check to see if an existing table or index can be used to
75864 int iCol; /* Index of column <column> */
75895 Index *pIdx; /* Iterator variable */
75897 /* The collation sequence used by the comparison. If an index is to
75904 ** it is not, it is not possible to use any index.
75936 /* Could not found an existing table or index to use as the RHS b-tree.
76046 ** filled with single-field index keys representing the results
76051 ** column is used to build the index keys. If both 'x' and the
76088 ** For each expression, build an index key from the evaluation and
76090 ** that columns affinity when building index keys. If <expr> is not
76266 /* In this case, the RHS is an index b-tree.
76552 int iCol, /* Index of the column to extract */
76578 int iColumn, /* Index of the table column */
77118 ** i is the index of the column. For a new.rowid reference, p1 is
78173 ** Add a new element to the pAggInfo->aCol[] array. Return the index of
78189 ** Add a new element to the pAggInfo->aFunc[] array. Return the index of
78469 ** CREATE INDEX command. The second is a table name. The table name in
78470 ** the CREATE TABLE or CREATE INDEX statement is replaced with the third
78476 ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
78477 ** -> 'CREATE INDEX i ON def(a, b, c)'
78597 ** TRIGGER, not CREATE INDEX and CREATE TABLE.
78777 int iDb; /* Index of database containing pTab */
78797 /* Drop the table and index from the internal schema. */
78800 /* Reload the table, index and permanent trigger schemas. */
78869 /* Check that a table or index named 'zName' does not already exist
78874 "there is already another table or index with this name: %s", zName);
78972 "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN "
78976 "(type='table' OR type='index' OR type='trigger');",
79306 ** There is normally one row per index, with the index identified by the
79308 ** which the index belongs. In each such row, the stat column will be
79310 ** list is the number of rows in the index and in the table. The second
79311 ** integer is the average number of rows in the index that have the same
79312 ** value in the first column of the index. The third integer is the average
79313 ** number of rows in the index that have the same value for the first two
79315 ** the index which have the same value for the first N-1 columns. For
79316 ** a K-column index, there will be K+1 integers in the stat column. If
79317 ** the index is unique, then the last integer will be 1.
79323 ** the index is unordered and will not use the index for a range query.
79334 ** about the distribution of keys within an index. The index is identified by
79336 ** the index belongs. There are usually 10 rows in the sqlite_stat2
79337 ** table for each index.
79339 ** The sqlite_stat2 entries for an index that have sampleno between 0 and 9
79340 ** inclusive are samples of the left-most key value in the index taken at
79341 ** evenly spaced points along the index. Let the number of samples be S
79342 ** (10 in the standard build) and let C be the number of rows in the index.
79347 ** For i between 0 and S-1. Conceptually, the index space is divided into
79361 ** the sqlite_stat2 table. There are multiple entries for each index.
79362 ** The idx column names the index and the tbl column is the table of the
79363 ** index. If the idx and tbl columns are the same, then the sample is
79365 ** the left-most column of the index. The nEq column is the approximate
79366 ** number of entires in the index whose left-most column exactly matches
79369 ** number of distinct left-most entries in the index that are less than
79374 ** integer will be the number of prior index entires that are distinct in
79375 ** the left-most column. The second integer will be the number of prior index
79377 ** will be the number of prior index entries that are distinct in the first
79381 ** There can be an arbitrary number of sqlite_stat3 entries per index.
79409 const char *zWhere, /* Delete entries for this table or index */
79491 int iMin; /* Index of entry with minimum nEq and hash */
79508 ** are the number of rows in the table or index (C) and the number of samples
79702 Index *pOnlyIdx, /* If not NULL, only analyze this one index */
79703 int iStatCur, /* Index of VdbeCursor that writes the sqlite_stat1 table */
79707 Index *pIdx; /* An index to being analyzed */
79708 int iIdxCur; /* Cursor open on index being analyzed */
79714 int iDb; /* Index of database containing pTab */
79716 int regIdxname = iMem++; /* Register containing index name */
79726 int regCount = iMem++; /* Number of rows in the table or index */
79783 /* Open a cursor to the index to be analyzed. */
79789 /* Populate the register containing the index name. */
79814 ** Number of distinct entries in index considering the
79832 ** the index b-tree. */
79917 ** two columns are the names of the table and index. The third column
79919 ** index. The first integer in the list is the total number of entries
79920 ** in the index. There is one additional integer in the list for each
79922 ** rows of the table the index will select. If D is the count of distinct
79952 ** containing NULL as the index name and the row count as the content.
79975 ** Generate code that will cause the most recent index analysis to
80010 ** a database. If pOnlyIdx is not NULL then it is a single index
80013 static void analyzeTable(Parse *pParse, Table *pTab, Index *pOnlyIdx){
80050 Index *pIdx;
80112 ** This callback is invoked once for each index when reading the
80116 ** argv[1] = name of the index (might be NULL)
80124 Index *pIndex;
80166 ** If the Index.aSample variable is not NULL, delete the aSample[] array
80169 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
80193 ** Load content from the sqlite_stat3 table into the Index.aSample[]
80200 Index *pPrevIdx = 0; /* Previous index in the loop */
80221 char *zIndex; /* Index name */
80222 Index *pIdx; /* Pointer to the index object */
80253 char *zIndex; /* Index name */
80254 Index *pIdx; /* Pointer to the index object */
80322 ** contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
80324 ** Index.aSample[] arrays.
80352 Index *pIdx = sqliteHashData(i);
80824 const char *zType, /* "view", "trigger", or "index" */
80825 const Token *pName /* Name of the view, trigger, or index */
80845 ** These routines are used to make sure that an index, trigger, or
81061 int iDb /* Index of containing database. */
81099 int iSrc; /* Index in pTabList->a[] of table being read */
81100 int iDb; /* The index of the database the expression refers to */
81101 int iCol; /* Index of column in table */
81226 ** CREATE INDEX
81227 ** DROP INDEX
81267 int iDb, /* Index of the database containing the table to lock */
81531 ** a particular index given the name of that index
81532 ** and the name of the database that contains the index.
81536 ** table and the first matching index is returned. (No checking
81537 ** for duplicate index names is done.) The search order is
81541 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
81542 Index *p = 0;
81560 ** Reclaim the memory used by an index
81562 static void freeIndex(sqlite3 *db, Index *p){
81571 ** For the index called zIdxName which is found in the database iDb,
81572 ** unlike that index from its Table then remove the index from
81573 ** the index hash table and free all memory structures associated
81574 ** with the index.
81577 Index *pIndex;
81589 Index *p;
81590 /* Justification of ALWAYS(); The index must be on the list of
81714 Index *pIndex, *pNext;
81728 TESTONLY ( Index *pOld = ) sqlite3HashInsert(
81816 ** function returns the index of the named database in db->aDb[], or
81837 ** index of the named database in db->aDb[], or -1 if the named db
81862 ** pName2) that stores the unqualified table name. The index of the
81897 ** unqualified name for a new schema object (table, index, view or
81958 ** set to the index of the database that the table or view is to be
82006 ** index or table name in the same database. Issue an error message if
82028 sqlite3ErrorMsg(pParse, "there is already an index named %s", zName);
82335 ** field of the table under construction to be the index of the
82340 ** index for the key. No index is created for INTEGER PRIMARY KEYs.
82390 Index *p;
82439 Index *pIdx;
82443 ** then an index may have been created on this column before the
83063 ** root-page of a table or index in database iDb has changed from iFrom
83069 ** have the same rootpage number as the real table or index that is
83072 ** or tables and not the table/index that is actually being moved.
83094 Index *pIdx = sqliteHashData(pElem);
83138 Index *pIdx;
83147 ** table and index root-pages in order, starting with the numerically
83165 Index *pIdx;
83191 ** after a DROP INDEX or DROP TABLE command.
83197 const char *zName /* Name of index or table */
83258 /* Drop all SQLITE_MASTER table and index entries that refer to the
83534 ** Generate code that will erase and refill index *pIdx. This is
83535 ** used to initialize a newly created index or to recompute the
83536 ** content of an index in response to a REINDEX command.
83538 ** if memRootPage is not negative, it means that the index is newly
83540 ** root page number of the index. If memRootPage is negative, then
83541 ** the index already exists and must be cleared before being refilled and
83542 ** the root page number of the index is taken from pIndex->tnum.
83544 static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
83551 int tnum; /* Root page of index */
83553 KeyInfo *pKey; /* KeyInfo for index */
83555 int regIdxKey; /* Registers containing the index key */
83557 int regRecord; /* Register holding assemblied index record */
83594 /* Open the table. Loop through all rows of the table, inserting index
83654 ** Create a new index for an SQL table. pName1.pName2 is the name of the index
83656 ** be NULL for a primary key or an index that is created to satisfy a
83665 ** If the index is created successfully, return a pointer to the new Index
83666 ** structure. This is used by sqlite3AddPrimaryKey() to mark the index
83667 ** as the tables primary key (Index.autoIndex==2).
83669 SQLITE_PRIVATE Index *sqlite3CreateIndex(
83671 Token *pName1, /* First part of index name. May be NULL */
83672 Token *pName2, /* Second part of index name. May be NULL */
83673 SrcList *pTblName, /* Table to index. Use pParse->pNewTable if 0 */
83677 Token *pEnd, /* The ")" that closes the CREATE INDEX statement */
83679 int ifNotExist /* Omit error if index already exists */
83681 Index *pRet = 0; /* Pointer to return */
83683 Index *pIndex = 0; /* The index to be created */
83684 char *zName = 0; /* Name of the index */
83689 int sortOrderMask; /* 1 to honor DESC in index. 0 to ignore. */
83692 int iDb; /* Index of the database that is being written */
83693 Token *pName = 0; /* Unqualified name of the index to create */
83713 /* Use the two-part index name to determine the database
83723 /* If the index name was unqualified, check if the the table
83735 if( sqlite3FixInit(&sFix, pParse, iDb, "index", pName) &&
83776 ** Find the name of the index. Make sure there is not already another
83777 ** index or table with the same name.
83781 ** one of the index names collides with the name of a temporary table or
83782 ** index, then we will continue to process this index.
83803 sqlite3ErrorMsg(pParse, "index %s already exists", zName);
83812 Index *pLoop;
83820 /* Check for authorization to create an index.
83865 ** Allocate the index structure.
83870 ROUND8(sizeof(Index)) + /* Index structure */
83871 ROUND8(sizeof(tRowcnt)*(nCol+1)) + /* Index.aiRowEst */
83872 sizeof(char *)*nCol + /* Index.azColl */
83873 sizeof(int)*nCol + /* Index.aiColumn */
83874 sizeof(u8)*nCol + /* Index.aSortOrder */
83875 nName + 1 + /* Index.zName */
83882 pIndex->aiRowEst = (tRowcnt*)&zExtra[ROUND8(sizeof(Index))];
83899 /* Check to see if we should honor DESC requests on index columns
83908 ** load the column indices into the Index structure. Report an error
83912 ** more than once within the same index. Only the first instance of
83963 /* This routine has been called to create an automatic index as a
83971 ** Either way, check to see if the table already has such an index. If
83984 Index *pIdx;
84002 /* This constraint creates the same index as a previous
84007 ** explicitly specified behaviour for the index.
84022 /* Link the new Index structure to its table and to the other
84026 Index *p;
84042 /* If the db->init.busy is 0 then create the index on disk. This
84043 ** involves writing the index into the master table and filling in the
84044 ** index with the current table contents.
84046 ** The db->init.busy is 0 when the user first enters a CREATE INDEX
84048 ** CREATE INDEX statements are read out of the master table. In
84049 ** the latter case the index already exists on disk, which is why
84052 ** If pTblName==0 it means this index is generated as a primary key
84054 ** has just been created, it contains no data and the index initialization
84066 /* Create the rootpage for the index
84071 /* Gather the complete text of the CREATE INDEX statement into
84076 /* A named index with an explicit CREATE INDEX statement */
84077 zStmt = sqlite3MPrintf(db, "CREATE%s INDEX %.*s",
84082 /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
84087 /* Add an entry in sqlite_master for this index
84090 "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);",
84099 /* Fill the index with data and reparse the schema. Code an OP_Expire
84106 sqlite3MPrintf(db, "name='%q' AND type='index'", pIndex->zName));
84111 /* When adding an index to the list of indices for a table, make
84123 Index *pOther = pTab->pIndex;
84147 ** Fill the Index.aiRowEst[] array with default information - information
84150 ** aiRowEst[0] is suppose to contain the number of elements in the index.
84153 ** first column of the index. aiRowEst[2] is an estimate of the number
84155 ** of the index. And so forth. It must always be the case that
84164 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
84182 ** This routine will drop an existing named index. This routine
84183 ** implements the DROP INDEX statement.
84186 Index *pIndex;
84202 sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0);
84210 sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
84231 /* Generate code to remove the index and from the master table */
84236 "DELETE FROM %Q.%s WHERE name=%Q AND type='index'",
84258 ** The index of the new entry is returned in *pIdx.
84269 int *pIdx /* Write the index of a new slot here */
84330 ** Return the index in pList of the identifier named zId. Return -1
84365 int iStart /* Index in pSrc->a[] of first new slot */
84476 ** Assign VdbeCursor index numbers to all tables in a SrcList
84814 ** inserting multiple rows in a table, or inserting a row and index entries.)
84862 static int collationMatch(const char *zColl, Index *pIndex){
84882 Index *pIndex; /* An index associated with pTab */
84902 int iDb; /* The database index number */
84928 ** collating function. Forms 3 and 4 rebuild the named index or all
84934 char *z; /* Name of a table or index */
84937 Index *pIndex; /* An index associated with pTab */
84938 int iDb; /* The database index number */
84940 Token *pObjName; /* Name of the table or index to be reindexed */
84988 ** with OP_OpenRead or OP_OpenWrite to access database index pIdx.
84996 SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
85510 ** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
85715 Index *pIdx; /* For looping over indices of the table */
85954 ** cursor number base+i for the i-th index.
85960 ** index entries that point to that record.
86025 /* Delete the index and table entries. Skip this step if pTab is really
86054 ** index entries associated with a single row of a single table.
86063 ** cursor number iCur+i for the i-th index.
86075 Index *pIdx;
86086 ** Generate code that will assemble an index key and put it in register
86087 ** regOut. The key with be for index pIdx which is an index on pTab.
86088 ** iCur is the index of a cursor open on the pTab table and pointing to
86092 ** registers that holds the elements of the index key. The
86098 Index *pIdx, /* The index for which to generate a key */
86100 int regOut, /* Write the new index key to this register */
87897 ** search the schema a unique index on the parent key columns.
87901 ** is set to point to the unique index.
87907 ** array is the index of the child table column that is mapped by the FK
87909 ** of index *ppIdx. The second element of the array is the index of the
87913 ** If the required index cannot be found, either because:
87936 FKey *pFKey, /* Foreign key to find index for */
87937 Index **ppIdx, /* OUT: Unique index on parent table */
87938 int **paiCol /* OUT: Map of index columns in pFKey */
87940 Index *pIdx = 0; /* Value to return via *ppIdx */
87979 /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number
87981 ** column of pFKey, then this index is a winner. */
87985 ** the PRIMARY KEY of table pParent. The PRIMARY KEY index may be
87986 ** identified by the test (Index.autoIndex==2). */
87997 ** index matches those columns. Also, check that the index uses
88001 int iCol = pIdx->aiColumn[i]; /* Index of column in parent tbl */
88005 /* If the index uses a collation sequence that is different from
88006 ** the default collation sequence for the column, this index is
88068 int iDb, /* Index of database housing pTab */
88070 Index *pIdx, /* Unique index on parent key columns in pTab */
88225 Index *pIdx, /* Foreign key index */
88257 int iCol; /* Index of column in child table */
88432 ** For a DELETE operation, parameter regOld is passed the index of the
88455 int iDb; /* Index of database containing pTab */
88472 Index *pIdx = 0; /* Index on key columns in pTo */
88479 /* Find the parent table of this foreign key. Also find a unique index
88535 ** a cursor to use to search the unique index on the parent key columns
88557 Index *pIdx = 0; /* Foreign key index for pFKey */
88622 Index *pIdx = 0;
88739 Index *pIdx = 0; /* Parent key index for this FK */
88996 int iDb, /* The database index in sqlite3.aDb[] */
89011 ** Return a pointer to the column affinity string associated with index
89024 ** rowid that appears as the last column in every index.
89026 ** Memory for the buffer containing the column index affinity string
89027 ** is managed along with the rest of the Index structure. It will be
89030 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
89032 /* The first time a column affinity string for a particular index is
89034 ** a member of the Index structure for subsequent use.
89037 ** sqliteDeleteIndex() when the Index structure itself is cleaned
89061 ** for each column indexed by the index, according to the affinity of the
89121 Index *pIndex;
89166 int iDb, /* Index of the database holding pTab */
89347 ** foreach index on <table>
89348 ** open a write cursor on the <table> index
89349 ** open a read cursor on the corresponding <table2> index
89421 Index *pIdx; /* For looping over indices of the table */
89433 int iDb; /* Index of database holding TABLE */
89445 int *aRegIdx = 0; /* One register allocated to each index */
89680 ** the index into IDLIST of the primary key column. keyColumn is
89681 ** the index of the primary key as it appears in IDLIST, not as
89682 ** is appears in the original table. (The index of the primary
89713 ** key, the set the keyColumn variable to the primary key column index
89938 /* Generate code to check constraints and generate index keys and
90050 ** The regRowid parameter is the index of the register containing (1).
90061 ** The code generated by this routine store new index entries into
90062 ** registers identified by aRegIdx[]. No index entry is created for
90115 int baseCur, /* Index of a read/write cursor pointing at pTab */
90116 int regRowid, /* Index of the range of input registers */
90117 int *aRegIdx, /* Register used by each index. 0 for unused indices */
90132 Index *pIdx; /* Pointer to one of the indices */
90237 ** the triggers and remove both the table and index b-tree entries.
90241 ** GenerateRowIndexDelete(). This removes the index b-tree entries
90285 ** index and making sure that duplicate entries do not already exist.
90294 /* Create a key for accessing the index entry */
90313 continue; /* pIdx is not a UNIQUE index */
90325 /* Check to see if the new index entry will be unique */
90333 /* Generate code that executes if the new index entry is not unique */
90401 int baseCur, /* Index of a read/write cursor pointing at pTab */
90403 int *aRegIdx, /* Register used by each index. 0 for unused indices */
90411 Index *pIdx;
90466 Index *pIdx;
90515 ** Check to see if index pSrc is compatible as a source of data
90516 ** for index pDest in an insert transfer optimization. The rules
90517 ** for a compatible index:
90519 ** * The index is over the same set of columns
90524 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
90557 ** performance. Raw index records are transferred in the same way.
90584 Index *pSrcIdx, *pDestIdx; /* Source and destination indices */
90593 KeyInfo *pKey; /* Key information for an index */
90595 int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
90696 return 0; /* pDestIdx has no corresponding index in pSrc */
90745 ** of index entries might need to change.)
90747 ** (2) The destination has a unique index. (The xfer optimization
92388 int iDb; /* Database index for <database> */
92400 ** index of the database this pragma is being applied to in db.aDb[]. */
93014 Index *pIdx;
93038 Index *pIdx;
93231 Index *pIdx;
93261 Index *pIdx;
93292 sqlite3VdbeChangeP4(v, addr+3, " missing from index ", P4_STATIC);
93322 "wrong # of entries in index ", P4_STATIC);
93422 ** creating or dropping a table or index). The schema version is used by
93437 int iCookie; /* Cookie index. 1 for schema-cookie, 6 for user-cookie. */
93696 ** argv[1] = root page number for table or index. 0 for trigger or view.
93719 /* Call the parser to process a CREATE TABLE, INDEX or VIEW.
93722 ** structures that describe the table, index, or view.
93752 /* If the SQL column is blank it means this is an index that
93754 ** constraint for a CREATE TABLE. The index should have already
93756 ** to do here is record the root page number for that index.
93758 Index *pIndex;
93761 /* This can occur if there exists an index on a TEMP table which
93762 ** has the same name as another index on a permanent index. Since
93764 ** safely ignore the index on the permanent table.
93776 ** data structures for a single database file. The index of the
94139 ** Convert a schema pointer into the iDb index that indicates
94154 ** -1000000 as the incorrect index into db->aDb[] is much
94698 ** Return the index of a column in a table. Return -1 if the column
94713 ** When found, set *piTab and *piCol to the table index and column index
94722 int *piTab, /* Write index of pSrc->a[] here */
94723 int *piCol /* Write index of pSrc->a[*piTab].pTab->aCol[] here */
94726 int iCol; /* Index of column matching zCol */
94756 int iLeft, /* Index of first table to join in pSrc */
94757 int iColLeft, /* Index of column in first table */
94758 int iRight, /* Index of second table in pSrc */
94759 int iColRight, /* Index of column in second table */
94991 ** form a distinct entry. iTab is a sorting index that holds previously
95000 int iTab, /* A sorting index used to test for distinctness */
95260 ** KeyInfo structure is appropriate for initializing a virtual index to
95263 ** index to implement a DISTINCT test.
95537 int iCol = pExpr->iColumn; /* Index of column in pTab */
95766 int cnt; /* Index added to make the name unique */
97225 int iFrom, /* Index in p->pSrc->a[] of the inner subquery */
97663 ** INDEXED BY clause, then try to locate the specified index. If there
97664 ** was such a clause and the named index cannot be found, return
97672 Index *pIdx;
97678 sqlite3ErrorMsg(pParse, "no such index: %s", zIndex, 0);
97781 /* Locate the index named by the INDEXED BY clause, if any. */
98194 Index *pIdx /* Index used to optimize scan, or NULL */
98199 pIdx ? "USING COVERING INDEX " : "",
98460 ** The second form is preferred as a single index (or temp-table) may be
98463 ** BY and DISTINCT, and an index or separate temp-table for the other.
98475 ** index might end up being unused if the data can be
98478 ** we figure out that the sorting index is not needed. The addrSortIndex
98509 /* Open a virtual index to use for the distinct set.
98531 /* If sorting index that was created by a prior OP_OpenEphemeral
98659 int addrSortingIdx; /* The OP_OpenEphemeral for the sorting index */
98663 /* If there is a GROUP BY clause we might need a sorting index to
98664 ** implement it. Allocate that sorting index now. If it turns out
98694 ** it might be a single loop that uses an index to extract information
98709 ** each row into a sorting index, terminate the first loop,
98710 ** then loop over the sorting index in order to get the output
98878 ** is better to execute the op on an index, as indexes are almost
98883 Index *pIdx; /* Iterator variable */
98884 KeyInfo *pKeyInfo = 0; /* Keyinfo for scanned index */
98885 Index *pBest = 0; /* Best index found so far */
98891 /* Search for the index that has the least amount of columns. If
98892 ** there is such an index, and it has less columns than the table
98895 ** In this case set iRoot to the root page number of the index b-tree
98897 ** index.
98899 ** (2011-04-15) Do not do a full scan of an unordered index.
98946 ** index or indices to use) should place a different priority on
98975 VdbeComment((v, "%s() by index",
99424 int iTabDb; /* Index of the database holding pTab */
100008 int iDb; /* Index of the database to use */
100406 ** with an index greater than 32 may be accessed, 0xffffffff is returned.
100552 Index *pIdx; /* For looping over indices */
100556 int *aRegIdx = 0; /* One register assigned to each index to be updated */
100557 int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the
100625 ** The index cursors might not be used, but if they are used they
100640 ** of the UPDATE statement. Also find the column index
100687 ** array for each index associated with table being updated. Fill in
100693 aRegIdx = sqlite3DbMallocRaw(db, sizeof(Index*) * nIdx );
100792 ** Open every index that needs updating. Note that if any
100793 ** index could potentially invoke a REPLACE conflict resolution
100865 ** table and index records, and as the values for any new.* references
100943 /* Delete the index entries associated with the current record. */
100957 /* Insert the new index entries and the new record. */
101345 "SELECT 'CREATE INDEX vacuum_db.' || substr(sql,14)"
101346 " FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ");
101349 "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) "
101350 " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
102796 #define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */
102802 #define WHERE_IDX_ONLY 0x00800000 /* Use index only - omit table */
102808 #define WHERE_TEMP_INDEX 0x20000000 /* Uses an ephemeral index */
102875 ** The index in pWC->a[] of the new WhereTerm is returned on success.
103049 ** IMPLEMENTATION-OF: R-59926-26393 To be usable by an index a term must be
103137 Index *pIdx /* Must be compatible with this index, if not NULL */
103160 /* Figure out the collation sequence required from an index for
103387 ** potentially be used with an index if an appropriate index exists.
103388 ** This analysis does not consider whether or not the index exists; that
103413 int idxTerm /* Index of the OR-term to be analyzed */
103529 int iColumn = -1; /* Column index on lhs of IN operator */
103661 ** and the copy has idxParent set to the index of the original term.
103666 int idxTerm /* Index of the term to be analyzed */
103669 WhereMaskSet *pMaskSet; /* Set of table index masks */
103705 extraRight = x-1; /* ON clause terms may not be used with an index
103765 ** skipped. Or, if the children are satisfied by an index, the original
103944 ** an index for tables to the left of the join.
103971 ** uses the same collation sequence as the iCol'th column of index pIdx.
103975 ** If such an expression is found, its index in pList->a[] is returned. If
103982 Index *pIdx, /* Index to match column of */
103983 int iCol /* Column of index to match */
104007 ** index for the outer loop guarantees that rows with equal values for
104014 ** can benefit from any index on columns "b" and "c".
104019 Index *pIdx, /* The index being considered */
104022 int nEqCol /* Number of index columns with == */
104034 ** same table as index pIdx, return early. Finally, if there is no
104066 ** UNIQUE index that guarantees that the result of the query will be distinct
104076 Index *pIdx;
104099 ** 1. The index is itself UNIQUE, and
104101 ** 2. All of the columns in the index are either part of the pDistinct
104104 ** comparison and select-list expressions must match those of the index.
104117 /* This index implies that the DISTINCT qualifier is redundant. */
104132 ** the table has a cursor number of "base". pIdx is an index on pTab.
104138 ** All terms of the ORDER BY that match against the index must be either
104140 ** index do not need to satisfy this constraint.) The *pbRev value is
104147 Index *pIdx, /* The index we are testing */
104150 int nEqCol, /* Number of index columns with == constraints */
104151 int wsFlags, /* Index usages flags */
104155 int sortOrder = 0; /* XOR of index and ORDER BY sort direction */
104167 /* Argument pIdx must either point to a 'real' named index structure,
104168 ** or an index structure allocated on the stack by bestBtreeIndex() to
104169 ** represent the rowid index that is part of every table. */
104173 ** the index.
104177 ** of the index is also allowed to match against the ORDER BY
104184 int iColumn; /* The i-th column of the index. -1 for rowid */
104185 int iSortOrder; /* 1 for DESC, 0 for ASC on the i-th index term */
104186 const char *zColl; /* Name of the collating sequence for i-th index term */
104190 /* Can not use an index sort on anything that is not a column in the
104211 /* Term j of the ORDER BY clause does not match column i of the index */
104213 /* If an index column that is constrained by == fails to match an
104214 ** ORDER BY term, that is OK. Just ignore that column of the index
104218 /* Index column i is the rowid. All other terms match. */
104221 /* If an index column fails to match and is not constrained by ==
104222 ** then the index cannot satisfy the ORDER BY constraint.
104245 ** tables in the join, then we are assured that the index can be used
104255 /* All terms of the ORDER BY clause are covered by this index so
104256 ** this index can be used for sorting. */
104262 /* All terms of this index match some prefix of the ORDER BY clause
104263 ** and the index is UNIQUE and no terms on the tail of the ORDER BY
104267 ** even on a UNIQUE index, so disallow those cases. */
104388 WHERETRACE(("... Multi-index OR testing for term %d of %d....\n",
104424 WHERETRACE(("... multi-index OR cost=%.9g nrow=%.9g\n", rTotal, nRow));
104440 ** could be used with an index to access pSrc, assuming an appropriate
104441 ** index existed.
104462 ** possible to construct a transient index that would perform better
104463 ** than a full table scan even when the cost of constructing the index
104465 ** transient index.
104476 double costTempIdx; /* per-query cost of the transient index */
104482 /* There is no point in building an automatic index for a single scan */
104490 /* We already have some kind of index in use for this query. */
104517 WHERETRACE(("auto-index reduces cost from %.1f to %.1f\n",
104534 ** Generate code to construct the Index object for an automatic index
104536 ** makes use of the automatic index.
104541 struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
104543 WhereLevel *pLevel /* Write new index here */
104545 int nColumn; /* Number of columns in the constructed index */
104549 Index *pIdx; /* Object describing the transient index */
104553 KeyInfo *pKeyinfo; /* Key information for the index */
104554 int addrTop; /* Top of the index fill loop */
104555 int regRecord; /* Register holding an index record */
104564 ** transient index on 2nd and subsequent iterations of the loop. */
104569 /* Count the number of columns that will be added to the index
104591 ** covering index. A "covering index" is an index that contains all
104592 ** columns that are needed by the query. With a covering index, the
104594 ** be a covering index because the index will not be updated if the
104595 ** original table changes and the index and table cannot both be used
104610 /* Construct the Index object to describe this index */
104611 nByte = sizeof(Index);
104612 nByte += nColumn*sizeof(int); /* Index.aiColumn */
104613 nByte += nColumn*sizeof(char*); /* Index.azColl */
104614 nByte += nColumn; /* Index.aSortOrder */
104621 pIdx->zName = "auto-index";
104642 /* Add additional columns needed to make the automatic index into
104643 ** a covering index */
104660 /* Create the automatic index */
104667 /* Fill the automatic index with content */
104704 WHERETRACE(("Recomputing index info for %s...\n", pSrc->pTab->zName));
104838 ** Compute the best index for a virtual table.
104840 ** The best index is computed by the xBestIndex method of the virtual
104857 Bitmask notReady, /* Mask of cursors not available for index */
104861 sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */
104919 ** even though we might try to pick the best index multiple times.
104920 ** For each attempt at picking an index, the order of tables in the
104957 /* If there is an ORDER BY clause, and the selected virtual table index
104995 ** index. Store the results in aStat as follows:
105004 Index *pIdx, /* Index to consider domain of */
105191 ** by scanning an index for a range of values. The range may have an upper
105194 ** example, assuming that index p is on t1(a):
105204 ** The nEq parameter is passed the index of the index column subject to the
105206 ** optimized by the proposed index scan. For example, assuming index p is
105212 ** b, is the second left-most column of the index). Or, if the query is:
105230 Index *p, /* The index containing the range-compared column; "x" */
105231 int nEq, /* index into p->aCol[] of the range-compared column */
105299 ** column of an index and sqlite_stat3 histogram data is available
105300 ** for that index. When pExpr==NULL that means the constraint is
105314 Index *p, /* The index whose left-most column is pTerm */
105363 Index *p, /* The index whose left-most column is pTerm */
105403 ** index and in the main table.
105407 ** named index. If no such plan is found, then the returned cost is
105408 ** SQLITE_BIG_DBL. If a plan is found that uses the named index,
105414 ** index.
105427 Index *pProbe; /* An index we are evaluating */
105428 Index *pIdx; /* Copy of pProbe, or zero for IPK index */
105430 int idxEqTermMask; /* Index mask of valid equality operators */
105431 Index sPk; /* A fake index object for the primary key */
105432 tRowcnt aiRowEstPk[2]; /* The aiRowEst[] value for the sPk index */
105433 int aiColumnPk = -1; /* The aColumn[] value for the sPk index */
105441 ** use an index to satisfy IS NULL constraints on that table. This is
105443 ** a circumstance which the index cannot help us discover. Ticket #2177.
105452 /* An INDEXED BY clause specifies a particular index to use */
105457 /* There is no INDEXED BY clause. Create a fake Index object in local
105458 ** variable sPk to represent the rowid primary key index. Make this
105459 ** fake index the first in a chain of Index objects with all of the real
105461 Index *pFirst; /* First of real indices on the table */
105462 memset(&sPk, 0, sizeof(Index));
105496 ** index being evaluated. They are then used to determine the expected
105500 ** Number of equality terms that can be implemented using the index.
105501 ** In other words, the number of initial fields in the index that
105506 ** SQLite must perform on the index in question. For example, if the
105511 ** SQLite must perform 9 lookups on an index on (a, b), so nInMul is
105539 ** external sort (i.e. scanning the index being evaluated will not
105543 ** Boolean. True if a table lookup is required for each index entry
105544 ** visited. In other words, true if this is not a covering index.
105545 ** This is always false for the rowid primary key index of a table.
105547 ** used by the SELECT statement are present in the index (such an
105548 ** index is sometimes described as a covering index).
105549 ** For example, given the index on (a, b), the second of the following
105552 ** both available in the index.
105557 int nEq; /* Number of == or IN terms matching index */
105563 int bDist = !!pDistinct; /* True if index cannot help with DISTINCT */
105564 int bLookup = 0; /* True if not a covering index */
105567 WhereTerm *pFirstTerm = 0; /* First term matching the index */
105597 /* If the index being considered is UNIQUE, and there is an equality
105598 ** constraint for all columns in the index, then this search will find
105604 ** optimized using the index.
105634 /* If there is an ORDER BY clause and the index being considered will
105636 ** in wsFlags. Otherwise, if there is an ORDER BY clause but the index
105646 /* If there is a DISTINCT qualifier and this index will scan rows in
105656 /* If currently calculating the cost of using an index (not the IPK
105657 ** index), determine if all required column data may be obtained without
105658 ** using the main table (i.e. if the index is a covering
105659 ** index for this query). If it is, set the WHERE_IDX_ONLY flag in
105714 ** to do a binary search to locate a row in a table or index is roughly
105716 ** a table or index. The actual times can vary, with the size of
105722 ** not give us data on the relative sizes of table and index records.
105724 ** as index records
105731 ** the cost function to err on the side of choosing an index over
105742 /* For an index lookup followed by a table lookup:
105743 ** nInMul index searches to find the start of each index range
105744 ** + nRow steps through the index
105749 /* For a covering index:
105750 ** nInMul index searches to find the initial entry
105751 ** + nRow steps through the index
105777 /**** Cost of using this index has now been computed ****/
105780 ** be used with the current index, but which might lower the number
105782 ** matters if the current index is the least costly, so do not bother
105783 ** with this step if we already know this index will not be chosen.
105787 ** the notReady mask. When computing an "optimal" index, the notReady
105791 ** of notValid, then a optimal index that depends on inner joins loops
105792 ** might be selected even when there exists an optimal index that has
105807 /* Ignore the first nEq equality matches since the index
105817 /* Ignore the first nSkipRange range constraints since the index
105846 /* If this index is the best we have seen so far, then record this
105847 ** index and its cost in the pCost structure.
105860 /* If there was an INDEXED BY clause, then only that one index is
105864 /* Reset masks for the next index in the loop */
105870 ** is set, then reverse the order that the index will be scanned
105885 WHERETRACE(("best index is: %s\n",
106073 ** index.
106075 ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c).
106077 ** The index has as many as three equality constraints, but in this
106081 ** in consecutive registers and the index of the first register is returned.
106089 ** the index of that memory cell. The code that
106096 ** copy of the column affinity string of the index allocated using
106104 ** In the example above, the index on t1(a) has TEXT affinity. But since
106107 ** a key to search the index. Hence the first byte in the returned affinity
106120 Index *pIdx; /* The index being used for this loop */
106128 /* This module is only called on query plans that use an index. */
106152 ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */
106194 int iTerm, /* Index of this term. First is zero */
106214 ** is run and there is an index on (a, b), then this function returns a
106225 Index *pIndex = pPlan->u.pIdx;
106321 zMsg = sqlite3MAppendf(db, zMsg, "%s VIRTUAL TABLE INDEX %d:%s", zMsg,
106353 int omitTable; /* True if we use the index only */
106541 /* Case 3: A scan using an index.
106545 ** left-most columns of the index. It may also contain
106550 ** index is on (x,y,z), then the following clauses are all
106569 ** constraints but an index is selected anyway, in order
106597 Index *pIdx; /* The index we will be using */
106598 int iIdxCur; /* The VDBE cursor for the index */
106613 ** the first one after the nEq equality constraints in the index,
106648 /* If we are doing a reverse order scan on an ascending index, or
106649 ** a forward order scan on a descending index, interchange the
106666 /* Seek the index cursor to the start of the range. */
106736 /* Check if the index cursor is past the end of the range. */
106770 ** WHERE clause terms made redundant by the index range scan.
106789 ** CREATE INDEX i1 ON t1(a);
106790 ** CREATE INDEX i2 ON t1(b);
106791 ** CREATE INDEX i3 ON t1(c);
106961 /* Case 5: There is no usable index. We must do a complete
107057 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
107149 ** If an index can be used so that the natural output order of the table
107150 ** scan is correct for the ORDER BY clause, then that index is used and
107152 ** unnecessary sort of the result set if an index appropriate for the
107304 /* Chose the best index to use for each table in the FROM clause.
107308 ** pWInfo->a[].pIdx The index to use for this level of the loop.
107313 ** pWInfo->a[].iIdxCur The VDBE cursor for the index
107324 Index *pIdx; /* Index for FROM table at pTabItem */
107330 Bitmask notIndexed; /* Mask of tables that cannot use an index */
107385 WhereCost sCost; /* Cost information from best[Virtual]Index() */
107386 ExprList *pOrderBy; /* ORDER BY clause for index to optimize */
107387 ExprList *pDist; /* DISTINCT clause for index to optimize */
107418 ** index if it uses any index at all */
107437 ** index specified by its INDEXED BY clause. This rule ensures
107495 ** INDEXED BY clause attached to it, that the named index is being
107502 sqlite3ErrorMsg(pParse, "cannot use index: %s", pIdx->zName);
107506 ** guaranteed to find the index specified in the INDEXED BY clause
107507 ** if it find an index at all. */
107543 int iDb; /* Index of database containing table/index */
107583 Index *pIx = pLevel->plan.u.pIdx;
107612 ** and the index used to access it (if any). If the table itself
107613 ** is not used, its name is just '{}'. If no index is used
107614 ** the index is listed as "{}". If the primary key is used the
107615 ** index name is '*'.
107752 /* If this scan uses an index, make code substitutions to read data
107753 ** from the index in preference to the table. Sometimes, this means
107757 ** position in the index.
107763 ** reference the index.
107768 Index *pIdx = pLevel->plan.u.pIdx;
108070 ** If the index value yy_shift_ofst[S]+X is out of range or if the value
108670 int yyidx; /* Index of top element in stack */
108755 "THEN", "ELSE", "INDEX", "ALTER",
109033 /* 242 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
109042 /* 251 */ "cmd ::= DROP INDEX ifexists fullname",
110732 case 242: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
110755 sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
110768 sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
110775 case 251: /* cmd ::= DROP INDEX ifexists fullname */
111481 testcase( i==2 ); /* INDEX */
113367 /* SQLITE_RANGE */ "bind or column index out of range",
113900 int iDb = SQLITE_MAX_ATTACHED; /* sqlite3.aDb[] index of db to checkpoint */
114248 ** If an invalid limit index is supplied, report -1.
114339 int iIn; /* Input character index */
114340 int iOut = 0; /* Output character index */
115877 /* The full-text index is stored in a series of b+tree (-like)
115915 ** A position is the index of a word within the document. The first
115930 ** varint column; (index of new column)
115939 ** memory. A "position" is an index of a token in the token stream
116070 ** idx - index within level
116132 ** index into the term index, we clearly cannot simply update the term
116133 ** index when a document is deleted or updated. For deletions, we
116296 ** *piEndOffset. *piStartOffset should be set to the index of the first
116298 ** to the index of the first byte just past the end of the token in
116499 ** FTS4 virtual tables may maintain multiple indexes - one index of all terms
116503 ** It is possible to determine which index a b+-tree belongs to based on the
116504 ** value stored in the "%_segdir.level" column. Given this value L, the index
116506 ** level values between 0 and 1023 (inclusive) belong to index 0, all levels
116507 ** between 1024 and 2047 to index 1, and so on.
116509 ** It is considered impossible for an index to use more than 1024 levels. In
116601 ** A connection to a fulltext index is an instance of the following
116636 ** The following array of hash tables is used to buffer pending index
116643 ** A single FTS4 table may have multiple full-text indexes. For each index
116644 ** there is an entry in the aIndex[] array. Index 0 is an index of all the
116645 ** terms that appear in the document set. Each subsequent index in aIndex[]
116646 ** is an index of prefixes of a specific length.
116650 int nPrefix; /* Prefix length (0 for main terms index) */
116651 Fts3Hash hPending; /* Pending terms table for this index */
116706 ** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index
116720 #define FTS3_FULLTEXT_SEARCH 2 /* Full-text index search */
116763 int iColumn; /* Index of column this phrase must match */
117053 int iIn = 1; /* Index of next byte to read from input */
117054 int iOut = 0; /* Index of next byte to write to output */
117552 ** always maintain the main "terms" index, but may also maintain one or
117714 int iCol; /* Column index */
118057 int iCons = -1; /* Index of constraint to use */
118058 int iLangidCons = -1; /* Index of langid=x constraint, if present */
118214 ** table is missing a row that is present in the full-text index.
118578 int iCol1; /* The current column index in pp1 */
118579 int iCol2; /* The current column index in pp2 */
118598 ** for the same column (the column with index iCol1 and iCol2).
119262 int iIndex, /* Index to search (from 0 to p->nIndex-1) */
119330 ** Set up a cursor object for iterating through a full-text index or a
119336 int iIndex, /* Index to search (from 0 to p->nIndex-1) */
119408 int bFound = 0; /* True once an index has been found */
119573 ** If idxNum>=FTS3_FULLTEXT_SEARCH then use the full text index. The
119580 int idxNum, /* Strategy index */
119705 int iCol /* Index of column to read value from */
119953 sqlite3_result_text(pContext, "Index optimized", -1, SQLITE_STATIC);
119956 sqlite3_result_text(pContext, "Index already optimal", -1, SQLITE_STATIC);
120877 ** table actually contains the same data as the index. To prevent this from
120902 ** to retrieve the entire doclist for the token from the full-text index.
122173 int idxNum, /* Strategy index */
122243 int iCol /* Index of column to read value from */
123081 ** The iDefaultCol parameter should be passed the index of the table column
123763 int iToken; /* index of next token to be returned */
124895 int iToken; /* index of next token to be returned */
125114 ** When full-text index nodes are loaded from disk, the buffer that they
125116 ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer
125185 ** terms when querying the full-text index. See functions:
125198 int iIdx; /* Index within level, or 0x7FFFFFFF for PT */
125471 int eStmt, /* Index of statement to evaluate */
125525 ** Within each language id, a separate index is maintained to store the
125527 ** "prefix=" option). And each index consists of multiple levels ("relative
125530 ** All three of these values (the language id, the specific index and the
125531 ** level within the index) are encoded in 64-bit integer values stored
125536 ** Specifically, each language-id/index combination is allocated 1024
125537 ** 64-bit integer level values ("absolute levels"). The main terms index
125538 ** for language-id 0 is allocate values 0-1023. The first prefix index
125543 ** absolute levels that corresponds to language-id iLangid and index
125582 int iIndex, /* Index for p->aIndex[] */
125822 /* Add the term to the terms index */
126037 ** full-text index.
126080 ** This function allocates a new level iLevel index in the segdir table.
126082 ** with 0, so the allocated index is one greater than the value returned
126089 ** allocated index is 0.
126091 ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK
126097 int iIndex, /* Index for p->aIndex */
126108 /* Set variable iNext to the next available segdir index at level iLevel. */
126123 ** segment and allocate (newly freed) index 0 at level iLevel. Otherwise,
126124 ** if iNext is less than FTS3_MERGE_COUNT, allocate index iNext.
126638 int iIndex, /* Index for p->aIndex */
126687 ** the index. All that is required is a straight hash-lookup.
127343 ** Set *pnMax to the largest segment level in the database for the index
127395 int iIndex, /* Index for p->aIndex */
127904 int iIndex, /* Index in p->aIndex[] to merge */
127908 int iIdx = 0; /* Index of new segment */
127909 sqlite3_int64 iNewLevel = 0; /* Level/index to create new segment at */
127929 ** index. The idx of the new segment is always 0. */
127942 ** available segment index at level iLevel+1. The call to
128183 ** The entire FTS index is discarded and rebuilt. If the table is one
128184 ** created using the content=xxx option, then the new index is based on
128715 int iPos; /* Index of first token in snippet */
129040 int iCol, /* Index of column to create snippet from */
129387 ** file system. This is done because the full-text index doclist is required
129388 ** to calculate these values properly, and the full-text index doclist is
130355 int iCell; /* Index of current cell in pNode */
130381 int iCoord; /* Index of constrained coordinate */
130710 ** Remove cell the cell with index iCell from node pNode.
131191 ** integer value equal to iRowid. Return the index of this cell.
131211 ** Return the index of the cell containing a pointer to node pNode
132560 ** Delete the cell at index iCell of node pNode. After removing the
132781 int iCell; /* Index of iDelete cell in pLeaf */
133504 int iPattern = 0; /* Current byte index in zPattern */
133505 int iString = 0; /* Current byte index in zString */