Lines Matching refs:pIdxInfo
105408 sqlite3_index_info *pIdxInfo
105415 pIdxInfo->estimatedCost = (double)100;
105416 pIdxInfo->estimatedRows = 100;
105417 pIdxInfo->idxNum = 0;
105418 for(i=0, p=pIdxInfo->aConstraint; i<pIdxInfo->nConstraint; i++, p++){
105422 pIdxInfo->aConstraintUsage[i].omit = 1;
105423 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
105426 pIdxInfo->aConstraintUsage[i].omit = 1;
105427 pIdxInfo->idxNum = 1;
140486 static int pragmaVtabBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
140492 pIdxInfo->estimatedCost = (double)1;
140494 pConstraint = pIdxInfo->aConstraint;
140497 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
140506 pIdxInfo->estimatedCost = (double)2147483647;
140507 pIdxInfo->estimatedRows = 2147483647;
140511 pIdxInfo->aConstraintUsage[j].argvIndex = 1;
140512 pIdxInfo->aConstraintUsage[j].omit = 1;
140514 pIdxInfo->estimatedCost = (double)20;
140515 pIdxInfo->estimatedRows = 20;
140517 pIdxInfo->aConstraintUsage[j].argvIndex = 2;
140518 pIdxInfo->aConstraintUsage[j].omit = 1;
162101 sqlite3_index_info *pIdxInfo;
162197 pIdxInfo = sqlite3DbMallocZero(pParse->db, sizeof(*pIdxInfo)
162201 if( pIdxInfo==0 ){
162205 pHidden = (struct HiddenIndexInfo*)&pIdxInfo[1];
162209 pIdxInfo->aConstraint = pIdxCons;
162210 pIdxInfo->aOrderBy = pIdxOrderBy;
162211 pIdxInfo->aConstraintUsage = pUsage;
162261 pIdxInfo->nConstraint = j;
162272 pIdxInfo->nOrderBy = j;
162275 return pIdxInfo;
162282 static void freeIndexInfo(sqlite3 *db, sqlite3_index_info *pIdxInfo){
162285 assert( pIdxInfo!=0 );
162286 pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
162289 for(i=0; i<pIdxInfo->nConstraint; i++){
162293 sqlite3DbFree(db, pIdxInfo);
164838 sqlite3_index_info *pIdxInfo, /* Populated object for xBestIndex */
164844 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
164846 struct sqlite3_index_constraint_usage *pUsage = pIdxInfo->aConstraintUsage;
164853 int nConstraint = pIdxInfo->nConstraint;
164861 pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
164875 assert( pIdxInfo->needToFreeIdxStr==0 );
164876 pIdxInfo->idxStr = 0;
164877 pIdxInfo->idxNum = 0;
164878 pIdxInfo->orderByConsumed = 0;
164879 pIdxInfo->estimatedCost = SQLITE_BIG_DBL / (double)2;
164880 pIdxInfo->estimatedRows = 25;
164881 pIdxInfo->idxFlags = 0;
164882 pIdxInfo->colUsed = (sqlite3_int64)pSrc->colUsed;
164886 rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo);
164903 pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
164916 testcase( pIdxInfo->needToFreeIdxStr );
164948 pIdxInfo->orderByConsumed = 0;
164949 pIdxInfo->idxFlags &= ~SQLITE_INDEX_SCAN_UNIQUE;
164960 if( pIdxInfo->needToFreeIdxStr ){
164961 sqlite3_free(pIdxInfo->idxStr);
164962 pIdxInfo->idxStr = 0;
164963 pIdxInfo->needToFreeIdxStr = 0;
164977 testcase( pIdxInfo->needToFreeIdxStr );
164982 pNew->u.vtab.idxNum = pIdxInfo->idxNum;
164983 pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
164984 pIdxInfo->needToFreeIdxStr = 0;
164985 pNew->u.vtab.idxStr = pIdxInfo->idxStr;
164986 pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ?
164987 pIdxInfo->nOrderBy : 0);
164989 pNew->rRun = sqlite3LogEstFromDouble(pIdxInfo->estimatedCost);
164990 pNew->nOut = sqlite3LogEst(pIdxInfo->estimatedRows);
164994 if( pIdxInfo->idxFlags & SQLITE_INDEX_SCAN_UNIQUE ){
165026 SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){
165027 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
165029 if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
165031 int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset;
165046 SQLITE_API int sqlite3_vtab_in(sqlite3_index_info *pIdxInfo, int iCons, int bHandle){
165047 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
165067 sqlite3_index_info *pIdxInfo, /* Copy of first argument to xBestIndex */
165071 HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1];
165074 if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
165078 WhereTerm *pTerm = &pH->pWC->a[pIdxInfo->aConstraint[iCons].iTermOffset];
165099 SQLITE_API int sqlite3_vtab_distinct(sqlite3_index_info *pIdxInfo){
165100 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
186117 static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
186120 pIdxInfo->estimatedRows = nRow;
186130 static void fts3SetUniqueFlag(sqlite3_index_info *pIdxInfo){
186133 pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE;
208210 sqlite3_index_info *pIdxInfo
208223 pConstraint = pIdxInfo->aConstraint;
208224 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
208239 if( pIdxInfo->nOrderBy>0
208240 && pIdxInfo->aOrderBy[0].iColumn<0
208241 && pIdxInfo->aOrderBy[0].desc==0
208243 pIdxInfo->orderByConsumed = 1;
208255 pIdxInfo->idxNum = 0;
208257 pIdxInfo->estimatedCost = 1.0;
208259 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
208260 pIdxInfo->aConstraintUsage[i].omit = 1;
208262 pIdxInfo->idxNum = 1; /* Only JSON supplied. Plan 1 */
208265 pIdxInfo->aConstraintUsage[i].argvIndex = 2;
208266 pIdxInfo->aConstraintUsage[i].omit = 1;
208267 pIdxInfo->idxNum = 3; /* Both JSON and ROOT are supplied. Plan 3 */
210524 static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
210539 for(ii=0; ii<pIdxInfo->nConstraint; ii++){
210540 if( pIdxInfo->aConstraint[ii].op==SQLITE_INDEX_CONSTRAINT_MATCH ){
210545 assert( pIdxInfo->idxStr==0 );
210546 for(ii=0; ii<pIdxInfo->nConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){
210547 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii];
210555 pIdxInfo->aConstraintUsage[jj].argvIndex = 0;
210556 pIdxInfo->aConstraintUsage[jj].omit = 0;
210558 pIdxInfo->idxNum = 1;
210559 pIdxInfo->aConstraintUsage[ii].argvIndex = 1;
210560 pIdxInfo->aConstraintUsage[jj].omit = 1;
210568 pIdxInfo->estimatedCost = 30.0;
210569 pIdxInfo->estimatedRows = 1;
210570 pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE;
210592 pIdxInfo->aConstraintUsage[ii].argvIndex = (iIdx/2);
210593 pIdxInfo->aConstraintUsage[ii].omit = doOmit;
210598 pIdxInfo->idxNum = 2;
210599 pIdxInfo->needToFreeIdxStr = 1;
210601 pIdxInfo->idxStr = sqlite3_malloc( iIdx+1 );
210602 if( pIdxInfo->idxStr==0 ){
210605 memcpy(pIdxInfo->idxStr, zIdxStr, iIdx+1);
210609 pIdxInfo->estimatedCost = (double)6.0 * (double)nRow;
210610 pIdxInfo->estimatedRows = nRow;
214288 static int geopolyBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
214295 for(ii=0; ii<pIdxInfo->nConstraint; ii++){
214296 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii];
214312 pIdxInfo->idxNum = 1;
214313 pIdxInfo->idxStr = "rowid";
214314 pIdxInfo->aConstraintUsage[iRowidTerm].argvIndex = 1;
214315 pIdxInfo->aConstraintUsage[iRowidTerm].omit = 1;
214316 pIdxInfo->estimatedCost = 30.0;
214317 pIdxInfo->estimatedRows = 1;
214318 pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE;
214322 pIdxInfo->idxNum = idxNum;
214323 pIdxInfo->idxStr = "rtree";
214324 pIdxInfo->aConstraintUsage[iFuncTerm].argvIndex = 1;
214325 pIdxInfo->aConstraintUsage[iFuncTerm].omit = 0;
214326 pIdxInfo->estimatedCost = 300.0;
214327 pIdxInfo->estimatedRows = 10;
214330 pIdxInfo->idxNum = 4;
214331 pIdxInfo->idxStr = "fullscan";
214332 pIdxInfo->estimatedCost = 3000000.0;
214333 pIdxInfo->estimatedRows = 100000;
221911 static int statBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
221923 for(i=0; i<pIdxInfo->nConstraint; i++){
221924 if( pIdxInfo->aConstraint[i].op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue;
221925 if( pIdxInfo->aConstraint[i].usable==0 ){
221929 switch( pIdxInfo->aConstraint[i].iColumn ){
221946 pIdxInfo->aConstraintUsage[iSchema].argvIndex = ++i;
221947 pIdxInfo->aConstraintUsage[iSchema].omit = 1;
221948 pIdxInfo->idxNum |= 0x01;
221951 pIdxInfo->aConstraintUsage[iName].argvIndex = ++i;
221952 pIdxInfo->idxNum |= 0x02;
221955 pIdxInfo->aConstraintUsage[iAgg].argvIndex = ++i;
221956 pIdxInfo->idxNum |= 0x04;
221958 pIdxInfo->estimatedCost = 1.0;
221964 if( ( pIdxInfo->nOrderBy==1
221965 && pIdxInfo->aOrderBy[0].iColumn==0
221966 && pIdxInfo->aOrderBy[0].desc==0
221968 ( pIdxInfo->nOrderBy==2
221969 && pIdxInfo->aOrderBy[0].iColumn==0
221970 && pIdxInfo->aOrderBy[0].desc==0
221971 && pIdxInfo->aOrderBy[1].iColumn==1
221972 && pIdxInfo->aOrderBy[1].desc==0
221975 pIdxInfo->orderByConsumed = 1;
221976 pIdxInfo->idxNum |= 0x08;
222719 static int dbpageBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
222728 for(i=0; i<pIdxInfo->nConstraint; i++){
222729 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[i];
222737 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
222738 pIdxInfo->aConstraintUsage[i].omit = 1;
222746 pIdxInfo->estimatedCost = 1.0e6;
222749 for(i=0; i<pIdxInfo->nConstraint; i++){
222750 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[i];
222752 pIdxInfo->estimatedRows = 1;
222753 pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE;
222754 pIdxInfo->estimatedCost = 1.0;
222755 pIdxInfo->aConstraintUsage[i].argvIndex = iPlan ? 2 : 1;
222756 pIdxInfo->aConstraintUsage[i].omit = 1;
222761 pIdxInfo->idxNum = iPlan;
222763 if( pIdxInfo->nOrderBy>=1
222764 && pIdxInfo->aOrderBy[0].iColumn<=0
222765 && pIdxInfo->aOrderBy[0].desc==0
222767 pIdxInfo->orderByConsumed = 1;
247407 sqlite3_index_info *pIdxInfo
247412 pIdxInfo->estimatedCost = (double)100;
247413 pIdxInfo->estimatedRows = 100;
247414 pIdxInfo->idxNum = 0;
247415 for(i=0, p=pIdxInfo->aConstraint; i<pIdxInfo->nConstraint; i++, p++){
247419 pIdxInfo->aConstraintUsage[i].omit = 1;
247420 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
248125 static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){
248131 pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE;
255659 sqlite3_index_info *pIdxInfo
255662 pIdxInfo->estimatedCost = (double)500;
255663 pIdxInfo->estimatedRows = 500;