Lines Matching defs:pIdx

10787 ** Within the union, pIdx is only used when wsFlags&WHERE_INDEXED is true.
10797 Index *pIdx; /* Index when WHERE_INDEXED is true */
10820 int iIdxCur; /* The VDBE cursor used to access pIdx */
49549 Index *pIdx = (Index *)sqliteHashData(p);
49550 if( pIdx->tnum==(int)iRoot ){
49551 iTab = pIdx->pTable->tnum;
50533 ** as the first argument. Write into *pIdx the index into pPage->aData[]
50544 static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
50604 *pIdx = pc + x;
50631 *pIdx = top;
71419 Index *pIdx;
71437 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
71439 for(j=0; j<pIdx->nColumn; j++){
71440 if( pIdx->aiColumn[j]==iCol ){
75920 Index *pIdx; /* Iterator variable */
75934 for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){
75935 if( (pIdx->aiColumn[0]==iCol)
75936 && sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], 0)==pReq
75937 && (!mustBeUnique || (pIdx->nColumn==1 && pIdx->onError!=OE_None))
75942 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
75945 sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
75947 VdbeComment((v, "%s", pIdx->zName));
79732 Index *pIdx; /* An index to being analyzed */
79792 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
79798 if( pOnlyIdx && pOnlyIdx!=pIdx ) continue;
79799 VdbeNoopComment((v, "Begin analysis of %s", pIdx->zName));
79800 nCol = pIdx->nColumn;
79803 pKey = sqlite3IndexKeyinfo(pParse, pIdx);
79809 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
79810 sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIdx->tnum, iDb,
79812 VdbeComment((v, "%s", pIdx->zName));
79815 sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, pIdx->zName, 0);
79870 assert( pIdx->azColl!=0 );
79871 assert( pIdx->azColl[i]!=0 );
79872 pColl = sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
79893 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, pIdx->nColumn, regRowid);
79921 sqlite3VdbeAddOp3(v, OP_Column, iTabCur, pIdx->aiColumn[0], regSample);
79922 sqlite3ColumnDefault(v, pTab, pIdx->aiColumn[0], regSample);
80075 Index *pIdx;
80100 if( (pIdx = sqlite3FindIndex(db, z, 0))!=0 ){
80101 analyzeTable(pParse, pIdx->pTable, pIdx);
80115 if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){
80116 analyzeTable(pParse, pIdx->pTable, pIdx);
80194 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
80196 if( pIdx->aSample ){
80198 for(j=0; j<pIdx->nSample; j++){
80199 IndexSample *p = &pIdx->aSample[j];
80204 sqlite3DbFree(db, pIdx->aSample);
80207 pIdx->nSample = 0;
80208 pIdx->aSample = 0;
80212 UNUSED_PARAMETER(pIdx);
80226 int idx = 0; /* slot in pIdx->aSample[] for next sample */
80228 IndexSample *pSample; /* A slot in pIdx->aSample[] */
80247 Index *pIdx; /* Pointer to the index object */
80253 pIdx = sqlite3FindIndex(db, zIndex, zDb);
80254 if( pIdx==0 ) continue;
80255 assert( pIdx->nSample==0 );
80256 pIdx->nSample = nSample;
80257 pIdx->aSample = sqlite3DbMallocZero(db, nSample*sizeof(IndexSample));
80258 pIdx->avgEq = pIdx->aiRowEst[1];
80259 if( pIdx->aSample==0 ){
80279 Index *pIdx; /* Pointer to the index object */
80285 pIdx = sqlite3FindIndex(db, zIndex, zDb);
80286 if( pIdx==0 ) continue;
80287 if( pIdx==pPrevIdx ){
80290 pPrevIdx = pIdx;
80293 assert( idx<pIdx->nSample );
80294 pSample = &pIdx->aSample[idx];
80298 if( idx==pIdx->nSample-1 ){
80300 for(i=0, sumEq=0; i<=idx-1; i++) sumEq += pIdx->aSample[i].nEq;
80301 pIdx->avgEq = (pSample->nLt - sumEq)/pSample->nDLt;
80303 if( pIdx->avgEq<=0 ) pIdx->avgEq = 1;
80377 Index *pIdx = sqliteHashData(i);
80378 sqlite3DefaultRowEst(pIdx);
80380 sqlite3DeleteIndexSamples(db, pIdx);
80381 pIdx->aSample = 0;
82464 Index *pIdx;
82471 for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){
82472 assert( pIdx->nColumn==1 );
82473 if( pIdx->aiColumn[0]==i ){
82474 pIdx->azColl[0] = p->aCol[i].zColl;
82567 ** to the specified offset in the buffer and updates *pIdx to refer
82575 static void identPut(char *z, int *pIdx, char *zSignedIdent){
82578 i = *pIdx;
82595 *pIdx = i;
83119 Index *pIdx = sqliteHashData(pElem);
83120 if( pIdx->tnum==iFrom ){
83121 pIdx->tnum = iTo;
83163 Index *pIdx;
83166 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
83167 destroyRootPage(pParse, pIdx->tnum, iDb);
83190 Index *pIdx;
83196 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
83197 int iIdx = pIdx->tnum;
83198 assert( pIdx->pSchema==pTab->pSchema );
83559 ** Generate code that will erase and refill index *pIdx. This is
84009 Index *pIdx;
84010 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
84012 assert( pIdx->onError!=OE_None );
84013 assert( pIdx->autoIndex );
84016 if( pIdx->nColumn!=pIndex->nColumn ) continue;
84017 for(k=0; k<pIdx->nColumn; k++){
84020 if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
84021 z1 = pIdx->azColl[k];
84025 if( k==pIdx->nColumn ){
84026 if( pIdx->onError!=pIndex->onError ){
84034 if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){
84038 if( pIdx->onError==OE_Default ){
84039 pIdx->onError = pIndex->onError;
84189 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
84190 tRowcnt *a = pIdx->aiRowEst;
84194 a[0] = pIdx->pTable->nRowEst;
84197 for(i=1; i<=pIdx->nColumn; i++){
84201 if( pIdx->onError!=OE_None ){
84202 a[pIdx->nColumn] = 1;
84283 ** The index of the new entry is returned in *pIdx.
84294 int *pIdx /* Write the index of a new slot here */
84302 *pIdx = -1;
84309 *pIdx = n;
85013 ** with OP_OpenRead or OP_OpenWrite to access database index pIdx.
85021 SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
85023 int nCol = pIdx->nColumn;
85033 char *zColl = pIdx->azColl[i];
85036 pKey->aSortOrder[i] = pIdx->aSortOrder[i];
85740 Index *pIdx; /* For looping over indices of the table */
85807 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
85863 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
85864 assert( pIdx->pSchema==pTab->pSchema );
85865 sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb);
85927 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
85928 sqlite3VdbeAddOp2(v, OP_Close, iCur + i, pIdx->tnum);
86100 Index *pIdx;
86103 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
86105 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iCur, 0, 0);
86106 sqlite3VdbeAddOp3(pParse->pVdbe, OP_IdxDelete, iCur+i, r1,pIdx->nColumn+1);
86112 ** regOut. The key with be for index pIdx which is an index on pTab.
86123 Index *pIdx, /* The index for which to generate a key */
86124 int iCur, /* Cursor number for the pIdx->pTable table */
86130 Table *pTab = pIdx->pTable;
86134 nCol = pIdx->nColumn;
86138 int idx = pIdx->aiColumn[j];
86151 zAff = sqlite3IndexAffinityStr(v, pIdx);
87965 Index *pIdx = 0; /* Value to return via *ppIdx */
88002 for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){
88003 if( pIdx->nColumn==nCol && pIdx->onError!=OE_None ){
88004 /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number
88012 if( pIdx->autoIndex==2 ){
88026 int iCol = pIdx->aiColumn[i]; /* Index of column in parent tbl */
88037 if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break;
88048 if( i==nCol ) break; /* pIdx is usable */
88053 if( !pIdx ){
88061 *ppIdx = pIdx;
88095 Index *pIdx, /* Unique index on parent key columns in pTab */
88123 if( pIdx==0 ){
88124 /* If pIdx is NULL, then the parent key is the INTEGER PRIMARY KEY
88155 KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
88157 sqlite3VdbeAddOp3(v, OP_OpenRead, iCur, pIdx->tnum, iDb);
88177 int iParent = pIdx->aiColumn[i]+1+regData;
88179 if( pIdx->aiColumn[i]==pTab->iPKey ){
88190 sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v,pIdx), P4_TRANSIENT);
88250 Index *pIdx, /* Foreign key index */
88252 int *aiCol, /* Map from pIdx cols to child table cols */
88264 assert( !pIdx || pIdx->pTable==pTab );
88289 if( pIdx ){
88291 iCol = pIdx->aiColumn[i];
88497 Index *pIdx = 0; /* Index on key columns in pTo */
88513 if( !pTo || locateFkeyIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){
88534 assert( pFKey->nCol==1 || (aiFree && pIdx) );
88552 char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zName;
88569 fkLookupParent(pParse, iDb, pTo, pIdx, pFKey, aiCol, regOld, -1,isIgnore);
88574 fkLookupParent(pParse, iDb, pTo, pIdx, pFKey, aiCol, regNew, +1,isIgnore);
88582 Index *pIdx = 0; /* Foreign key index for pFKey */
88593 if( locateFkeyIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ){
88611 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1);
88620 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regOld, 1);
88647 Index *pIdx = 0;
88648 locateFkeyIndex(pParse, pTab, p, &pIdx, 0);
88649 if( pIdx ){
88650 for(i=0; i<pIdx->nColumn; i++) mask |= COLUMN_MASK(pIdx->aiColumn[i]);
88764 Index *pIdx = 0; /* Parent key index for this FK */
88773 if( locateFkeyIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ) return 0;
88786 tToCol.z = pIdx ? pTab->aCol[pIdx->aiColumn[i]].zName : "oid";
89037 ** pIdx. A column affinity string has one character for each column in
89055 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
89056 if( !pIdx->zColAff ){
89066 Table *pTab = pIdx->pTable;
89068 pIdx->zColAff = (char *)sqlite3DbMallocRaw(0, pIdx->nColumn+2);
89069 if( !pIdx->zColAff ){
89073 for(n=0; n<pIdx->nColumn; n++){
89074 pIdx->zColAff[n] = pTab->aCol[pIdx->aiColumn[n]].affinity;
89076 pIdx->zColAff[n++] = SQLITE_AFF_INTEGER;
89077 pIdx->zColAff[n] = 0;
89080 return pIdx->zColAff;
89446 Index *pIdx; /* For looping over indices of the table */
90015 for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){
90157 Index *pIdx; /* Pointer to one of the indices */
90313 for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){
90320 regIdx = sqlite3GetTempRange(pParse, pIdx->nColumn+1);
90321 for(i=0; i<pIdx->nColumn; i++){
90322 int idx = pIdx->aiColumn[i];
90330 sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn+1, aRegIdx[iCur]);
90331 sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v, pIdx), P4_TRANSIENT);
90332 sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn+1);
90335 onError = pIdx->onError;
90337 sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
90338 continue; /* pIdx is not a UNIQUE index */
90356 sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
90372 zSep = pIdx->nColumn>1 ? "columns " : "column ";
90373 for(j=0; j<pIdx->nColumn; j++){
90374 char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
90380 pIdx->nColumn>1 ? " are not unique" : " is not unique", -1);
90436 Index *pIdx;
90444 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){}
90491 Index *pIdx;
90499 for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
90500 KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
90501 assert( pIdx->pSchema==pTab->pSchema );
90502 sqlite3VdbeAddOp4(v, op, i+baseCur, pIdx->tnum, iDb,
90504 VdbeComment((v, "%s", pIdx->zName));
93039 Index *pIdx;
93042 pIdx = sqlite3FindIndex(db, zRight, zDb);
93043 if( pIdx ){
93045 pTab = pIdx->pTable;
93051 for(i=0; i<pIdx->nColumn; i++){
93052 int cnum = pIdx->aiColumn[i];
93063 Index *pIdx;
93069 pIdx = pTab->pIndex;
93070 if( pIdx ){
93077 while(pIdx){
93079 sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, pIdx->zName, 0);
93080 sqlite3VdbeAddOp2(v, OP_Integer, pIdx->onError!=OE_None, 3);
93083 pIdx = pIdx->pNext;
93256 Index *pIdx;
93259 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
93260 sqlite3VdbeAddOp2(v, OP_Integer, pIdx->tnum, 2+cnt);
93286 Index *pIdx;
93297 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
93313 r1 = sqlite3GenerateIndexKey(pParse, pIdx, 1, 3, 0);
93314 jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, j+2, 0, r1, pIdx->nColumn+1);
93318 sqlite3VdbeChangeP4(v, addr+4, pIdx->zName, P4_TRANSIENT);
93324 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
93348 sqlite3VdbeChangeP4(v, addr+7, pIdx->zName, P4_TRANSIENT);
97697 Index *pIdx;
97698 for(pIdx=pTab->pIndex;
97699 pIdx && sqlite3StrICmp(pIdx->zName, zIndex);
97700 pIdx=pIdx->pNext
97702 if( !pIdx ){
97707 pFrom->pIndex = pIdx;
98219 Index *pIdx /* Index used to optimize scan, or NULL */
98224 pIdx ? "USING COVERING INDEX " : "",
98225 pIdx ? pIdx->zName : "",
98908 Index *pIdx; /* Iterator variable */
98929 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
98930 if( pIdx->bUnordered==0 && (!pBest || pIdx->nColumn<pBest->nColumn) ){
98931 pBest = pIdx;
100577 Index *pIdx; /* For looping over indices */
100655 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
100716 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){}
100721 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
100727 for(i=0; i<pIdx->nColumn; i++){
100728 if( aXRef[pIdx->aiColumn[i]]>=0 ){
100827 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
100828 if( pIdx->onError==OE_Replace ){
100834 for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
100837 KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
100838 sqlite3VdbeAddOp4(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, iDb,
101009 for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
103162 Index *pIdx /* Must be compatible with this index, if not NULL */
103175 if( iColumn>=0 && pIdx && pTerm->eOperator!=WO_ISNULL ){
103182 idxaff = pIdx->pTable->aCol[iColumn].affinity;
103193 for(j=0; pIdx->aiColumn[j]!=iColumn; j++){
103194 if( NEVER(j>=pIdx->nColumn) ) return 0;
103196 if( pColl && sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue;
103996 ** uses the same collation sequence as the iCol'th column of index pIdx.
103997 ** Argument iBase is the cursor number used for the table that pIdx refers
104006 int iBase, /* Cursor for table associated with pIdx */
104007 Index *pIdx, /* Index to match column of */
104011 const char *zColl = pIdx->azColl[iCol];
104016 && p->iColumn==pIdx->aiColumn[iCol]
104030 ** This routine determines if pIdx can be used to assist in processing a
104044 Index *pIdx, /* The index being considered */
104045 int base, /* Cursor number for the table pIdx is on */
104052 if( pIdx->zName==0 || pDistinct==0 || pDistinct->nExpr>=BMS ) return 0;
104059 ** same table as index pIdx, return early. Finally, if there is no
104060 ** matching "col=X" expression and the column is on the same table as pIdx,
104078 for(i=nEqCol; mask && i<pIdx->nColumn; i++){
104079 int iExpr = findIndexCol(pParse, pDistinct, base, pIdx, i);
104101 Index *pIdx;
104131 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
104132 if( pIdx->onError==OE_None ) continue;
104133 for(i=0; i<pIdx->nColumn; i++){
104134 int iCol = pIdx->aiColumn[i];
104135 if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx)
104136 && 0>findIndexCol(pParse, pDistinct, iBase, pIdx, i)
104141 if( i==pIdx->nColumn ){
104151 ** This routine decides if pIdx can be used to satisfy the ORDER BY
104152 ** clause. If it can, it returns 1. If pIdx cannot satisfy the
104157 ** the table has a cursor number of "base". pIdx is an index on pTab.
104159 ** nEqCol is the number of columns of pIdx that are used as equality
104172 Index *pIdx, /* The index we are testing */
104187 if( pIdx->bUnordered ) return 0;
104192 /* Argument pIdx must either point to a 'real' named index structure,
104195 assert( pIdx->zName || (pIdx->nColumn==1 && pIdx->aiColumn[0]==-1) );
104200 ** Note that indices have pIdx->nColumn regular columns plus
104205 for(i=j=0, pTerm=pOrderBy->a; j<nTerm && i<=pIdx->nColumn; i++){
104223 if( pIdx->zName && i<pIdx->nColumn ){
104224 iColumn = pIdx->aiColumn[i];
104225 if( iColumn==pIdx->pTable->iPKey ){
104228 iSortOrder = pIdx->aSortOrder[i];
104229 zColl = pIdx->azColl[i];
104242 }else if( i==pIdx->nColumn ){
104252 assert( pIdx->aSortOrder!=0 || iColumn==-1 );
104284 if( pIdx->onError!=OE_None && i==pIdx->nColumn
104573 int nByte; /* Byte of memory needed for pIdx */
104574 Index *pIdx; /* Object describing the transient index */
104640 pIdx = sqlite3DbMallocZero(pParse->db, nByte);
104641 if( pIdx==0 ) return;
104642 pLevel->plan.u.pIdx = pIdx;
104643 pIdx->azColl = (char**)&pIdx[1];
104644 pIdx->aiColumn = (int*)&pIdx->azColl[nColumn];
104645 pIdx->aSortOrder = (u8*)&pIdx->aiColumn[nColumn];
104646 pIdx->zName = "auto-index";
104647 pIdx->nColumn = nColumn;
104648 pIdx->pTable = pTable;
104658 pIdx->aiColumn[n] = pTerm->u.leftColumn;
104660 pIdx->azColl[n] = ALWAYS(pColl) ? pColl->zName : "BINARY";
104671 pIdx->aiColumn[n] = i;
104672 pIdx->azColl[n] = "BINARY";
104678 pIdx->aiColumn[n] = i;
104679 pIdx->azColl[n] = "BINARY";
104686 pKeyinfo = sqlite3IndexKeyinfo(pParse, pIdx);
104695 sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 1);
105029 Index *pIdx, /* Index to consider domain of */
105042 assert( pIdx->nSample>0 );
105044 n = pIdx->aiRowEst[0];
105045 aSample = pIdx->aSample;
105051 for(i=0; i<pIdx->nSample; i++){
105069 for(i=0; i<pIdx->nSample; i++){
105087 for(i=0; i<pIdx->nSample; i++){
105092 if( i<pIdx->nSample ){
105101 pColl = sqlite3GetCollSeq(db, SQLITE_UTF8, 0, *pIdx->azColl);
105104 *pIdx->azColl);
105115 for(; i<pIdx->nSample; i++){
105146 ** or equal to pVal. Or if i==pIdx->nSample, then all samples are less
105150 assert( i<pIdx->nSample );
105159 iUpper = i>=pIdx->nSample ? n : aSample[i].nLt;
105162 aStat[1] = pIdx->avgEq;
105453 Index *pIdx; /* Copy of pProbe, or zero for IPK index */
105478 pIdx = pProbe = pSrc->pIndex;
105506 pIdx = 0;
105511 for(; pProbe; pIdx=pProbe=pProbe->pNext){
105598 pTerm = findTerm(pWC, iCur, j, notReady, eqTermMask, pIdx);
105639 if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pIdx) ){
105640 WhereTerm *pTop = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pIdx);
105641 WhereTerm *pBtm = findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pIdx);
105686 if( pIdx && wsFlags ){
105689 for(j=0; j<pIdx->nColumn; j++){
105690 int x = pIdx->aiColumn[j];
105765 if( pIdx ){
105866 pSrc->pTab->zName, (pIdx ? pIdx->zName : "ipk"),
105874 if( (!pIdx || wsFlags)
105882 pCost->plan.u.pIdx = pIdx;
105904 assert( pCost->plan.u.pIdx==0 || (pCost->plan.wsFlags&WHERE_ROWID_EQ)==0 );
105906 || pCost->plan.u.pIdx==0
105907 || pCost->plan.u.pIdx==pSrc->pIndex
105912 pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk")
106145 Index *pIdx; /* The index being used for this loop */
106155 pIdx = pLevel->plan.u.pIdx;
106163 zAff = sqlite3DbStrDup(pParse->db, sqlite3IndexAffinityStr(v, pIdx));
106170 assert( pIdx->nColumn>=nEq );
106173 int k = pIdx->aiColumn[j];
106174 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
106250 Index *pIndex = pPlan->u.pIdx;
106326 ((flags & WHERE_TEMP_INDEX)?"": pLevel->plan.u.pIdx->zName),
106622 Index *pIdx; /* The index we will be using */
106629 pIdx = pLevel->plan.u.pIdx;
106631 k = (nEq==pIdx->nColumn ? -1 : pIdx->aiColumn[nEq]);
106643 && (pIdx->nColumn>nEq)
106646 /* assert( pOrderBy->a[0].pExpr->iColumn==pIdx->aiColumn[nEq] ); */
106655 pRangeEnd = findTerm(pWC, iCur, k, notReady, (WO_LT|WO_LE), pIdx);
106659 pRangeStart = findTerm(pWC, iCur, k, notReady, (WO_GT|WO_GE), pIdx);
106677 if( (nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC))
106678 || (bRev && pIdx->nColumn==nEq)
107082 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
107083 if( pIdx ){
107084 sqlite3DbFree(db, pIdx->zColAff);
107085 sqlite3DbFree(db, pIdx);
107333 ** pWInfo->a[].pIdx The index to use for this level of the loop.
107334 ** pWInfo->a[].wsFlags WHERE_xxx flags associated with pIdx
107349 Index *pIdx; /* Index for FROM table at pTabItem */
107446 || sCost.plan.u.pIdx==pTabItem->pIndex );
107524 pIdx = pTabList->a[bestJ].pIndex;
107525 if( pIdx ){
107527 sqlite3ErrorMsg(pParse, "cannot use index: %s", pIdx->zName);
107533 assert( bestPlan.plan.u.pIdx==pIdx );
107608 Index *pIx = pLevel->plan.u.pIdx;
107666 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
107668 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
107793 Index *pIdx = pLevel->plan.u.pIdx;
107795 assert( pIdx!=0 );
107801 for(j=0; j<pIdx->nColumn; j++){
107802 if( pOp->p2==pIdx->aiColumn[j] ){
107809 || j<pIdx->nColumn );