Home | History | Annotate | Download | only in orig

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 */
49521 Index *pIdx = (Index *)sqliteHashData(p);
49522 if( pIdx->tnum==(int)iRoot ){
49523 iTab = pIdx->pTable->tnum;
50505 ** as the first argument. Write into *pIdx the index into pPage->aData[]
50516 static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
50576 *pIdx = pc + x;
50603 *pIdx = top;
71391 Index *pIdx;
71409 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
71411 for(j=0; j<pIdx->nColumn; j++){
71412 if( pIdx->aiColumn[j]==iCol ){
75884 Index *pIdx; /* Iterator variable */
75898 for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){
75899 if( (pIdx->aiColumn[0]==iCol)
75900 && sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], 0)==pReq
75901 && (!mustBeUnique || (pIdx->nColumn==1 && pIdx->onError!=OE_None))
75906 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
75909 sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
75911 VdbeComment((v, "%s", pIdx->zName));
79696 Index *pIdx; /* An index to being analyzed */
79756 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
79762 if( pOnlyIdx && pOnlyIdx!=pIdx ) continue;
79763 VdbeNoopComment((v, "Begin analysis of %s", pIdx->zName));
79764 nCol = pIdx->nColumn;
79767 pKey = sqlite3IndexKeyinfo(pParse, pIdx);
79773 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
79774 sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIdx->tnum, iDb,
79776 VdbeComment((v, "%s", pIdx->zName));
79779 sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, pIdx->zName, 0);
79834 assert( pIdx->azColl!=0 );
79835 assert( pIdx->azColl[i]!=0 );
79836 pColl = sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
79857 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, pIdx->nColumn, regRowid);
79885 sqlite3VdbeAddOp3(v, OP_Column, iTabCur, pIdx->aiColumn[0], regSample);
79886 sqlite3ColumnDefault(v, pTab, pIdx->aiColumn[0], regSample);
80039 Index *pIdx;
80064 if( (pIdx = sqlite3FindIndex(db, z, 0))!=0 ){
80065 analyzeTable(pParse, pIdx->pTable, pIdx);
80079 if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){
80080 analyzeTable(pParse, pIdx->pTable, pIdx);
80158 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
80160 if( pIdx->aSample ){
80162 for(j=0; j<pIdx->nSample; j++){
80163 IndexSample *p = &pIdx->aSample[j];
80168 sqlite3DbFree(db, pIdx->aSample);
80171 pIdx->nSample = 0;
80172 pIdx->aSample = 0;
80176 UNUSED_PARAMETER(pIdx);
80190 int idx = 0; /* slot in pIdx->aSample[] for next sample */
80192 IndexSample *pSample; /* A slot in pIdx->aSample[] */
80211 Index *pIdx; /* Pointer to the index object */
80217 pIdx = sqlite3FindIndex(db, zIndex, zDb);
80218 if( pIdx==0 ) continue;
80219 assert( pIdx->nSample==0 );
80220 pIdx->nSample = nSample;
80221 pIdx->aSample = sqlite3DbMallocZero(db, nSample*sizeof(IndexSample));
80222 pIdx->avgEq = pIdx->aiRowEst[1];
80223 if( pIdx->aSample==0 ){
80243 Index *pIdx; /* Pointer to the index object */
80249 pIdx = sqlite3FindIndex(db, zIndex, zDb);
80250 if( pIdx==0 ) continue;
80251 if( pIdx==pPrevIdx ){
80254 pPrevIdx = pIdx;
80257 assert( idx<pIdx->nSample );
80258 pSample = &pIdx->aSample[idx];
80262 if( idx==pIdx->nSample-1 ){
80264 for(i=0, sumEq=0; i<=idx-1; i++) sumEq += pIdx->aSample[i].nEq;
80265 pIdx->avgEq = (pSample->nLt - sumEq)/pSample->nDLt;
80267 if( pIdx->avgEq<=0 ) pIdx->avgEq = 1;
80341 Index *pIdx = sqliteHashData(i);
80342 sqlite3DefaultRowEst(pIdx);
80344 sqlite3DeleteIndexSamples(db, pIdx);
80345 pIdx->aSample = 0;
82428 Index *pIdx;
82435 for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){
82436 assert( pIdx->nColumn==1 );
82437 if( pIdx->aiColumn[0]==i ){
82438 pIdx->azColl[0] = p->aCol[i].zColl;
82531 ** to the specified offset in the buffer and updates *pIdx to refer
82539 static void identPut(char *z, int *pIdx, char *zSignedIdent){
82542 i = *pIdx;
82559 *pIdx = i;
83083 Index *pIdx = sqliteHashData(pElem);
83084 if( pIdx->tnum==iFrom ){
83085 pIdx->tnum = iTo;
83127 Index *pIdx;
83130 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
83131 destroyRootPage(pParse, pIdx->tnum, iDb);
83154 Index *pIdx;
83160 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
83161 int iIdx = pIdx->tnum;
83162 assert( pIdx->pSchema==pTab->pSchema );
83523 ** Generate code that will erase and refill index *pIdx. This is
83973 Index *pIdx;
83974 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
83976 assert( pIdx->onError!=OE_None );
83977 assert( pIdx->autoIndex );
83980 if( pIdx->nColumn!=pIndex->nColumn ) continue;
83981 for(k=0; k<pIdx->nColumn; k++){
83984 if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
83985 z1 = pIdx->azColl[k];
83989 if( k==pIdx->nColumn ){
83990 if( pIdx->onError!=pIndex->onError ){
83998 if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){
84002 if( pIdx->onError==OE_Default ){
84003 pIdx->onError = pIndex->onError;
84153 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
84154 tRowcnt *a = pIdx->aiRowEst;
84158 a[0] = pIdx->pTable->nRowEst;
84161 for(i=1; i<=pIdx->nColumn; i++){
84165 if( pIdx->onError!=OE_None ){
84166 a[pIdx->nColumn] = 1;
84247 ** The index of the new entry is returned in *pIdx.
84258 int *pIdx /* Write the index of a new slot here */
84266 *pIdx = -1;
84273 *pIdx = n;
84977 ** with OP_OpenRead or OP_OpenWrite to access database index pIdx.
84985 SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
84987 int nCol = pIdx->nColumn;
84997 char *zColl = pIdx->azColl[i];
85000 pKey->aSortOrder[i] = pIdx->aSortOrder[i];
85704 Index *pIdx; /* For looping over indices of the table */
85771 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
85827 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
85828 assert( pIdx->pSchema==pTab->pSchema );
85829 sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb);
85891 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
85892 sqlite3VdbeAddOp2(v, OP_Close, iCur + i, pIdx->tnum);
86064 Index *pIdx;
86067 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
86069 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iCur, 0, 0);
86070 sqlite3VdbeAddOp3(pParse->pVdbe, OP_IdxDelete, iCur+i, r1,pIdx->nColumn+1);
86076 ** regOut. The key with be for index pIdx which is an index on pTab.
86087 Index *pIdx, /* The index for which to generate a key */
86088 int iCur, /* Cursor number for the pIdx->pTable table */
86094 Table *pTab = pIdx->pTable;
86098 nCol = pIdx->nColumn;
86102 int idx = pIdx->aiColumn[j];
86115 zAff = sqlite3IndexAffinityStr(v, pIdx);
87929 Index *pIdx = 0; /* Value to return via *ppIdx */
87966 for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){
87967 if( pIdx->nColumn==nCol && pIdx->onError!=OE_None ){
87968 /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number
87976 if( pIdx->autoIndex==2 ){
87990 int iCol = pIdx->aiColumn[i]; /* Index of column in parent tbl */
88001 if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break;
88012 if( i==nCol ) break; /* pIdx is usable */
88017 if( !pIdx ){
88025 *ppIdx = pIdx;
88059 Index *pIdx, /* Unique index on parent key columns in pTab */
88087 if( pIdx==0 ){
88088 /* If pIdx is NULL, then the parent key is the INTEGER PRIMARY KEY
88119 KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
88121 sqlite3VdbeAddOp3(v, OP_OpenRead, iCur, pIdx->tnum, iDb);
88141 int iParent = pIdx->aiColumn[i]+1+regData;
88143 if( pIdx->aiColumn[i]==pTab->iPKey ){
88154 sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v,pIdx), P4_TRANSIENT);
88214 Index *pIdx, /* Foreign key index */
88216 int *aiCol, /* Map from pIdx cols to child table cols */
88228 assert( !pIdx || pIdx->pTable==pTab );
88253 if( pIdx ){
88255 iCol = pIdx->aiColumn[i];
88461 Index *pIdx = 0; /* Index on key columns in pTo */
88477 if( !pTo || locateFkeyIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){
88498 assert( pFKey->nCol==1 || (aiFree && pIdx) );
88516 char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zName;
88533 fkLookupParent(pParse, iDb, pTo, pIdx, pFKey, aiCol, regOld, -1,isIgnore);
88538 fkLookupParent(pParse, iDb, pTo, pIdx, pFKey, aiCol, regNew, +1,isIgnore);
88546 Index *pIdx = 0; /* Foreign key index for pFKey */
88557 if( locateFkeyIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ){
88575 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1);
88584 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regOld, 1);
88611 Index *pIdx = 0;
88612 locateFkeyIndex(pParse, pTab, p, &pIdx, 0);
88613 if( pIdx ){
88614 pIdx->nColumn; i++) mask |= COLUMN_MASK(pIdx->aiColumn[i]);
88728 Index *pIdx = 0; /* Parent key index for this FK */
88737 if( locateFkeyIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ) return 0;
88750 tToCol.z = pIdx ? pTab->aCol[pIdx->aiColumn[i]].zName : "oid";
89001 ** pIdx. A column affinity string has one character for each column in
89019 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
89020 if( !pIdx->zColAff ){
89030 Table *pTab = pIdx->pTable;
89032 pIdx->zColAff = (char *)sqlite3DbMallocRaw(0, pIdx->nColumn+2);
89033 if( !pIdx->zColAff ){
89037 for(n=0; n<pIdx->nColumn; n++){
89038 pIdx->zColAff[n] = pTab->aCol[pIdx->aiColumn[n]].affinity;
89040 pIdx->zColAff[n++] = SQLITE_AFF_INTEGER;
89041 pIdx->zColAff[n] = 0;
89044 return pIdx->zColAff;
89410 Index *pIdx; /* For looping over indices of the table */
89979 for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){
90121 Index *pIdx; /* Pointer to one of the indices */
90277 for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){
90284 regIdx = sqlite3GetTempRange(pParse, pIdx->nColumn+1);
90285 for(i=0; i<pIdx->nColumn; i++){
90286 int idx = pIdx->aiColumn[i];
90294 sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn+1, aRegIdx[iCur]);
90295 sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v, pIdx), P4_TRANSIENT);
90296 sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn+1);
90299 onError = pIdx->onError;
90301 sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
90302 continue; /* pIdx is not a UNIQUE index */
90320 sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
90336 zSep = pIdx->nColumn>1 ? "columns " : "column ";
90337 for(j=0; j<pIdx->nColumn; j++){
90338 char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
90344 pIdx->nColumn>1 ? " are not unique" : " is not unique", -1);
90400 Index *pIdx;
90408 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){}
90455 Index *pIdx;
90463 for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
90464 KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
90465 assert( pIdx->pSchema==pTab->pSchema );
90466 sqlite3VdbeAddOp4(v, op, i+baseCur, pIdx->tnum, iDb,
90468 VdbeComment((v, "%s", pIdx->zName));
93003 Index *pIdx;
93006 pIdx = sqlite3FindIndex(db, zRight, zDb);
93007 if( pIdx ){
93009 pTab = pIdx->pTable;
93015 for(i=0; i<pIdx->nColumn; i++){
93016 int cnum = pIdx->aiColumn[i];
93027 Index *pIdx;
93033 pIdx = pTab->pIndex;
93034 if( pIdx ){
93041 while(pIdx){
93043 sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, pIdx->zName, 0);
93044 sqlite3VdbeAddOp2(v, OP_Integer, pIdx->onError!=OE_None, 3);
93047 pIdx = pIdx->pNext;
93220 Index *pIdx;
93223 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
93224 sqlite3VdbeAddOp2(v, OP_Integer, pIdx->tnum, 2+cnt);
93250 Index *pIdx;
93261 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
93277 r1 = sqlite3GenerateIndexKey(pParse, pIdx, 1, 3, 0);
93278 jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, j+2, 0, r1, pIdx->nColumn+1);
93282 sqlite3VdbeChangeP4(v, addr+4, pIdx->zName, P4_TRANSIENT);
93288 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
93312 sqlite3VdbeChangeP4(v, addr+7, pIdx->zName, P4_TRANSIENT);
97661 Index *pIdx;
97662 for(pIdx=pTab->pIndex;
97663 pIdx && sqlite3StrICmp(pIdx->zName, zIndex);
97664 pIdx=pIdx->pNext
97666 if( !pIdx ){
97671 pFrom->pIndex = pIdx;
98183 Index *pIdx /* Index used to optimize scan, or NULL */
98188 pIdx ? "USING COVERING INDEX " : "",
98189 pIdx ? pIdx->zName : "",
98872 Index *pIdx; /* Iterator variable */
98893 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
98894 if( pIdx->bUnordered==0 && (!pBest || pIdx->nColumn<pBest->nColumn) ){
98895 pBest = pIdx;
100541 Index *pIdx; /* For looping over indices */
100619 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
100680 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){}
100685 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
100691 for(i=0; i<pIdx->nColumn; i++){
100692 if( aXRef[pIdx->aiColumn[i]]>=0 ){
100791 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
100792 if( pIdx->onError==OE_Replace ){
100798 for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
100801 KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
100802 sqlite3VdbeAddOp4(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, iDb,
100973 for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
103126 Index *pIdx /* Must be compatible with this index, if not NULL */
103139 if( iColumn>=0 && pIdx && pTerm->eOperator!=WO_ISNULL ){
103146 idxaff = pIdx->pTable->aCol[iColumn].affinity;
103157 for(j=0; pIdx->aiColumn[j]!=iColumn; j++){
103158 if( NEVER(j>=pIdx->nColumn) ) return 0;
103160 if( pColl && sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue;
103960 ** uses the same collation sequence as the iCol'th column of index pIdx.
103961 ** Argument iBase is the cursor number used for the table that pIdx refers
103970 int iBase, /* Cursor for table associated with pIdx */
103971 Index *pIdx, /* Index to match column of */
103975 const char *zColl = pIdx->azColl[iCol];
103980 && p->iColumn==pIdx->aiColumn[iCol]
103994 ** This routine determines if pIdx can be used to assist in processing a
104008 Index *pIdx, /* The index being considered */
104009 int base, /* Cursor number for the table pIdx is on */
104016 if( pIdx->zName==0 || pDistinct==0 || pDistinct->nExpr>=BMS ) return 0;
104023 ** same table as index pIdx, return early. Finally, if there is no
104024 ** matching "col=X" expression and the column is on the same table as pIdx,
104042 for(i=nEqCol; mask && i<pIdx->nColumn; i++){
104043 int iExpr = findIndexCol(pParse, pDistinct, base, pIdx, i);
104065 Index *pIdx;
104095 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
104096 if( pIdx->onError==OE_None ) continue;
104097 for(i=0; i<pIdx->nColumn; i++){
104098 int iCol = pIdx->aiColumn[i];
104099 if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx)
104100 && 0>findIndexCol(pParse, pDistinct, iBase, pIdx, i)
104105 if( i==pIdx->nColumn ){
104115 ** This routine decides if pIdx can be used to satisfy the ORDER BY
104116 ** clause. If it can, it returns 1. If pIdx cannot satisfy the
104121 ** the table has a cursor number of "base". pIdx is an index on pTab.
104123 ** nEqCol is the number of columns of pIdx that are used as equality
104136 Index *pIdx, /* The index we are testing */
104151 if( pIdx->bUnordered ) return 0;
104156 /* Argument pIdx must either point to a 'real' named index structure,
104159 assert( pIdx->zName || (pIdx->nColumn==1 && pIdx->aiColumn[0]==-1) );
104164 ** Note that indices have pIdx->nColumn regular columns plus
104169 for(i=j=0, pTerm=pOrderBy->a; j<nTerm && i<=pIdx->nColumn; i++){
104187 if( pIdx->zName && i<pIdx->nColumn ){
104188 iColumn = pIdx->aiColumn[i];
104189 if( iColumn==pIdx->pTable->iPKey ){
104192 iSortOrder = pIdx->aSortOrder[i];
104193 zColl = pIdx->azColl[i];
104206 }else if( i==pIdx->nColumn ){
104216 assert( pIdx->aSortOrder!=0 || iColumn==-1 );
104248 if( pIdx->onError!=OE_None && i==pIdx->nColumn
104537 int nByte; /* Byte of memory needed for pIdx
104538 Index *pIdx; /* Object describing the transient index */
104604 pIdx = sqlite3DbMallocZero(pParse->db, nByte);
104605 if( pIdx==0 ) return;
104606 pLevel->plan.u.pIdx = pIdx;
104607 pIdx->azColl = (char**)&pIdx[1];
104608 pIdx->aiColumn = (int*)&pIdx->azColl[nColumn];
104609 pIdx->aSortOrder = (u8*)&pIdx->aiColumn[nColumn];
104610 pIdx->zName = "auto-index";
104611 pIdx->nColumn = nColumn;
104612 pIdx->pTable = pTable;
104622 pIdx->aiColumn[n] = pTerm->u.leftColumn;
104624 pIdx->azColl[n] = ALWAYS(pColl) ? pColl->zName : "BINARY";
104635 pIdx->aiColumn[n] = i;
104636 pIdx->azColl[n] = "BINARY";
104642 pIdx->aiColumn[n] = i;
104643 pIdx->azColl[n] = "BINARY";
104650 pKeyinfo = sqlite3IndexKeyinfo(pParse, pIdx);
104659 sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 1);
104993 Index *pIdx, /* Index to consider domain of */
105006 assert( pIdx->nSample>0 );
105008 n = pIdx->aiRowEst[0];
105009 aSample = pIdx->aSample;
105015 for(i=0; i<pIdx->nSample; i++){
105033 for(i=0; i<pIdx->nSample; i++){
105051 for(i=0; i<pIdx->nSample; i++){
105056 if( i<pIdx->nSample ){
105065 pColl = sqlite3GetCollSeq(db, SQLITE_UTF8, 0, *pIdx->azColl);
105068 *pIdx->azColl);
105079 for(; i<pIdx->nSample; i++){
105110 ** or equal to pVal. Or if i==pIdx->nSample, then all samples are less
105114 assert( i<pIdx->nSample );
105123 iUpper = i>=pIdx->nSample ? n : aSample[i].nLt;
105126 aStat[1] = pIdx->avgEq;
105417 Index *pIdx; /* Copy of pProbe, or zero for IPK index */
105442 pIdx
105470 pIdx = 0;
105475 for(; pProbe; pIdx=pProbe=pProbe->pNext){
105562 pTerm = findTerm(pWC, iCur, j, notReady, eqTermMask, pIdx);
105603 if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pIdx) ){
105604 WhereTerm *pTop = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pIdx);
105605 WhereTerm *pBtm = findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pIdx);
105650 if( pIdx && wsFlags ){
105653 for(j=0; j<pIdx->nColumn; j++){
105654 int x = pIdx->aiColumn[j];
105729 if( pIdx ){
105830 pSrc->pTab->zName, (pIdx ? pIdx->zName : "ipk"),
105838 if( (!pIdx || wsFlags)
105846 pCost->plan.u.pIdx = pIdx;
105868 assert( pCost->plan.u.pIdx==0 || (pCost->plan.wsFlags&WHERE_ROWID_EQ)==0 );
105870 || pCost->plan.u.pIdx==0
105871 || pCost->plan.u.pIdx==pSrc->pIndex
105876 pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk")
106109 Index *pIdx; /* The index being used for this loop */
106119 pIdx = pLevel->plan.u.pIdx;
106127 zAff = sqlite3DbStrDup(pParse->db, sqlite3IndexAffinityStr(v, pIdx));
106134 assert( pIdx->nColumn>=nEq );
106137 int k = pIdx->aiColumn[j];
106138 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
106214 Index *pIndex = pPlan->u.pIdx;
106290 ((flags & WHERE_TEMP_INDEX)?"": pLevel->plan.u.pIdx->zName),
106586 Index *pIdx; /* The index we will be using */
106593 pIdx = pLevel->plan.u.pIdx;
106595 k = (nEq==pIdx->nColumn ? -1 : pIdx->aiColumn[nEq]);
106607 && (pIdx->nColumn>nEq)
106610 /* assert( pOrderBy->a[0].pExpr->iColumn==pIdx->aiColumn[nEq] ); */
106619 pRangeEnd = findTerm(pWC, iCur, k, notReady, (WO_LT|WO_LE), pIdx);
106623 pRangeStart = findTerm(pWC, iCur, k, notReady, (WO_GT|WO_GE), pIdx);
106641 if( (nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC))
106642 || (bRev && pIdx->nColumn==nEq)
107046 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
107047 if( pIdx ){
107048 sqlite3DbFree(db, pIdx->zColAff);
107049 sqlite3DbFree(db, pIdx);
107297 ** pWInfo->a[].pIdx The index to use for this level of the loop.
107298 ** pWInfo->a[].wsFlags WHERE_xxx flags associated with pIdx
107313 Index *pIdx; /* Index for FROM table at pTabItem */
107410 || sCost.plan.u.pIdx==pTabItem->pIndex );
107488 pIdx = pTabList->a[bestJ].pIndex;
107489 if( pIdx ){
107491 sqlite3ErrorMsg(pParse, "cannot use index: %s", pIdx->zName);
107497 assert( bestPlan.plan.u.pIdx==pIdx );
107572 Index *pIx = pLevel->plan.u.pIdx;
107630 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
107632 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
107757 Index *pIdx = pLevel->plan.u.pIdx;
107759 assert( pIdx!=0 );
107765 for(j=0; j<pIdx->nColumn; j++){
107766 if( pOp->p2==pIdx->aiColumn[j] ){
107773 || j<pIdx->nColumn );