Lines Matching refs:pIdxInfo
102902 sqlite3_index_info *pIdxInfo
102909 pIdxInfo->estimatedCost = (double)100;
102910 pIdxInfo->estimatedRows = 100;
102911 pIdxInfo->idxNum = 0;
102912 for(i=0, p=pIdxInfo->aConstraint; i<pIdxInfo->nConstraint; i++, p++){
102916 pIdxInfo->aConstraintUsage[i].omit = 1;
102917 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
102920 pIdxInfo->aConstraintUsage[i].omit = 1;
102921 pIdxInfo->idxNum = 1;
136928 static int pragmaVtabBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
136934 pIdxInfo->estimatedCost = (double)1;
136936 pConstraint = pIdxInfo->aConstraint;
136939 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
136948 pIdxInfo->estimatedCost = (double)2147483647;
136949 pIdxInfo->estimatedRows = 2147483647;
136953 pIdxInfo->aConstraintUsage[j].argvIndex = 1;
136954 pIdxInfo->aConstraintUsage[j].omit = 1;
136956 pIdxInfo->estimatedCost = (double)20;
136957 pIdxInfo->estimatedRows = 20;
136959 pIdxInfo->aConstraintUsage[j].argvIndex = 2;
136960 pIdxInfo->aConstraintUsage[j].omit = 1;
157733 sqlite3_index_info *pIdxInfo;
157829 pIdxInfo = sqlite3DbMallocZero(pParse->db, sizeof(*pIdxInfo)
157833 if( pIdxInfo==0 ){
157837 pHidden = (struct HiddenIndexInfo*)&pIdxInfo[1];
157841 pIdxInfo->aConstraint = pIdxCons;
157842 pIdxInfo->aOrderBy = pIdxOrderBy;
157843 pIdxInfo->aConstraintUsage = pUsage;
157893 pIdxInfo->nConstraint = j;
157904 pIdxInfo->nOrderBy = j;
157907 return pIdxInfo;
157914 static void freeIndexInfo(sqlite3 *db, sqlite3_index_info *pIdxInfo){
157917 assert( pIdxInfo!=0 );
157918 pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
157921 for(i=0; i<pIdxInfo->nConstraint; i++){
157925 sqlite3DbFree(db, pIdxInfo);
160202 ** Argument pIdxInfo is already populated with all constraints that may
160226 sqlite3_index_info *pIdxInfo, /* Populated object for xBestIndex */
160232 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
160234 struct sqlite3_index_constraint_usage *pUsage = pIdxInfo->aConstraintUsage;
160241 int nConstraint = pIdxInfo->nConstraint;
160249 pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
160263 assert( pIdxInfo->needToFreeIdxStr==0 );
160264 pIdxInfo->idxStr = 0;
160265 pIdxInfo->idxNum = 0;
160266 pIdxInfo->orderByConsumed = 0;
160267 pIdxInfo->estimatedCost = SQLITE_BIG_DBL / (double)2;
160268 pIdxInfo->estimatedRows = 25;
160269 pIdxInfo->idxFlags = 0;
160270 pIdxInfo->colUsed = (sqlite3_int64)pSrc->colUsed;
160274 rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo);
160291 pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
160304 testcase( pIdxInfo->needToFreeIdxStr );
160336 pIdxInfo->orderByConsumed = 0;
160337 pIdxInfo->idxFlags &= ~SQLITE_INDEX_SCAN_UNIQUE;
160348 if( pIdxInfo->needToFreeIdxStr ){
160349 sqlite3_free(pIdxInfo->idxStr);
160350 pIdxInfo->idxStr = 0;
160351 pIdxInfo->needToFreeIdxStr = 0;
160365 testcase( pIdxInfo->needToFreeIdxStr );
160370 pNew->u.vtab.idxNum = pIdxInfo->idxNum;
160371 pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
160372 pIdxInfo->needToFreeIdxStr = 0;
160373 pNew->u.vtab.idxStr = pIdxInfo->idxStr;
160374 pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ?
160375 pIdxInfo->nOrderBy : 0);
160377 pNew->rRun = sqlite3LogEstFromDouble(pIdxInfo->estimatedCost);
160378 pNew->nOut = sqlite3LogEst(pIdxInfo->estimatedRows);
160382 if( pIdxInfo->idxFlags & SQLITE_INDEX_SCAN_UNIQUE ){
160402 ** pIdxInfo must be an sqlite3_index_info structure passed into xBestIndex.
160414 SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){
160415 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
160417 if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
160419 int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset;
160434 SQLITE_API int sqlite3_vtab_in(sqlite3_index_info *pIdxInfo, int iCons, int bHandle){
160435 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
160455 sqlite3_index_info *pIdxInfo, /* Copy of first argument to xBestIndex */
160459 HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1];
160462 if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
160466 WhereTerm *pTerm = &pH->pWC->a[pIdxInfo->aConstraint[iCons].iTermOffset];
160487 SQLITE_API int sqlite3_vtab_distinct(sqlite3_index_info *pIdxInfo){
160488 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
160504 SQLITE_PRIVATE void sqlite3VtabUsesAllSchemas(sqlite3_index_info *pIdxInfo){
160505 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
181219 ** Set the pIdxInfo->estimatedRows variable to nRow. Unless this
181223 static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
181226 pIdxInfo->estimatedRows = nRow;
181232 ** Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this
181236 static void fts3SetUniqueFlag(sqlite3_index_info *pIdxInfo){
181239 pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE;
200691 sqlite3_index_info *pIdxInfo
200704 pConstraint = pIdxInfo->aConstraint;
200705 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
200729 pIdxInfo->idxNum = 0;
200731 pIdxInfo->estimatedCost = 1.0;
200733 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
200734 pIdxInfo->aConstraintUsage[i].omit = 1;
200736 pIdxInfo->idxNum = 1; /* Only JSON supplied. Plan 1 */
200739 pIdxInfo->aConstraintUsage[i].argvIndex = 2;
200740 pIdxInfo->aConstraintUsage[i].omit = 1;
200741 pIdxInfo->idxNum = 3; /* Both JSON and ROOT are supplied. Plan 3 */
202931 static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
202946 for(ii=0; ii<pIdxInfo->nConstraint; ii++){
202947 if( pIdxInfo->aConstraint[ii].op==SQLITE_INDEX_CONSTRAINT_MATCH ){
202952 assert( pIdxInfo->idxStr==0 );
202953 for(ii=0; ii<pIdxInfo->nConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){
202954 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii];
202962 pIdxInfo->aConstraintUsage[jj].argvIndex = 0;
202963 pIdxInfo->aConstraintUsage[jj].omit = 0;
202965 pIdxInfo->idxNum = 1;
202966 pIdxInfo->aConstraintUsage[ii].argvIndex = 1;
202967 pIdxInfo->aConstraintUsage[jj].omit = 1;
202975 pIdxInfo->estimatedCost = 30.0;
202976 pIdxInfo->estimatedRows = 1;
202977 pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE;
202998 pIdxInfo->aConstraintUsage[ii].argvIndex = (iIdx/2);
202999 pIdxInfo->aConstraintUsage[ii].omit = 1;
203004 pIdxInfo->idxNum = 2;
203005 pIdxInfo->needToFreeIdxStr = 1;
203006 if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){
203011 pIdxInfo->estimatedCost = (double)6.0 * (double)nRow;
203012 pIdxInfo->estimatedRows = nRow;
206823 static int geopolyBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
206829 for(ii=0; ii<pIdxInfo->nConstraint; ii++){
206830 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii];
206846 pIdxInfo->idxNum = 1;
206847 pIdxInfo->idxStr = "rowid";
206848 pIdxInfo->aConstraintUsage[iRowidTerm].argvIndex = 1;
206849 pIdxInfo->aConstraintUsage[iRowidTerm].omit = 1;
206850 pIdxInfo->estimatedCost = 30.0;
206851 pIdxInfo->estimatedRows = 1;
206852 pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE;
206856 pIdxInfo->idxNum = idxNum;
206857 pIdxInfo->idxStr = "rtree";
206858 pIdxInfo->aConstraintUsage[iFuncTerm].argvIndex = 1;
206859 pIdxInfo->aConstraintUsage[iFuncTerm].omit = 0;
206860 pIdxInfo->estimatedCost = 300.0;
206861 pIdxInfo->estimatedRows = 10;
206864 pIdxInfo->idxNum = 4;
206865 pIdxInfo->idxStr = "fullscan";
206866 pIdxInfo->estimatedCost = 3000000.0;
206867 pIdxInfo->estimatedRows = 100000;
214398 static int statBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
214409 for(i=0; i<pIdxInfo->nConstraint; i++){
214410 if( pIdxInfo->aConstraint[i].op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue;
214411 if( pIdxInfo->aConstraint[i].usable==0 ){
214415 switch( pIdxInfo->aConstraint[i].iColumn ){
214432 pIdxInfo->aConstraintUsage[iSchema].argvIndex = ++i;
214433 pIdxInfo->aConstraintUsage[iSchema].omit = 1;
214434 pIdxInfo->idxNum |= 0x01;
214437 pIdxInfo->aConstraintUsage[iName].argvIndex = ++i;
214438 pIdxInfo->idxNum |= 0x02;
214441 pIdxInfo->aConstraintUsage[iAgg].argvIndex = ++i;
214442 pIdxInfo->idxNum |= 0x04;
214444 pIdxInfo->estimatedCost = 1.0;
214450 if( ( pIdxInfo->nOrderBy==1
214451 && pIdxInfo->aOrderBy[0].iColumn==0
214452 && pIdxInfo->aOrderBy[0].desc==0
214454 ( pIdxInfo->nOrderBy==2
214455 && pIdxInfo->aOrderBy[0].iColumn==0
214456 && pIdxInfo->aOrderBy[0].desc==0
214457 && pIdxInfo->aOrderBy[1].iColumn==1
214458 && pIdxInfo->aOrderBy[1].desc==0
214461 pIdxInfo->orderByConsumed = 1;
214462 pIdxInfo->idxNum |= 0x08;
215197 static int dbpageBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
215205 for(i=0; i<pIdxInfo->nConstraint; i++){
215206 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[i];
215214 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
215215 pIdxInfo->aConstraintUsage[i].omit = 1;
215223 pIdxInfo->estimatedCost = 1.0e6;
215226 for(i=0; i<pIdxInfo->nConstraint; i++){
215227 struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[i];
215229 pIdxInfo->estimatedRows = 1;
215230 pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE;
215231 pIdxInfo->estimatedCost = 1.0;
215232 pIdxInfo->aConstraintUsage[i].argvIndex = iPlan ? 2 : 1;
215233 pIdxInfo->aConstraintUsage[i].omit = 1;
215238 pIdxInfo->idxNum = iPlan;
215240 if( pIdxInfo->nOrderBy>=1
215241 && pIdxInfo->aOrderBy[0].iColumn<=0
215242 && pIdxInfo->aOrderBy[0].desc==0
215244 pIdxInfo->orderByConsumed = 1;
215246 sqlite3VtabUsesAllSchemas(pIdxInfo);
237282 ** Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this
237286 static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){
237292 pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE;
244534 sqlite3_index_info *pIdxInfo
244536 pIdxInfo->estimatedCost = (double)500;
244537 pIdxInfo->estimatedRows = 500;