Lines Matching refs:pInfo
529 sqlite3_index_info *pInfo, /* The sqlite3_index_info object */ in sqlite3BestIndexLog() argument
584 zLogTab, iBI, pInfo->nConstraint in sqlite3BestIndexLog()
586 for(i=0; i<pInfo->nConstraint; i++){ in sqlite3BestIndexLog()
589 int iCol = pInfo->aConstraint[i].iColumn; in sqlite3BestIndexLog()
590 int op = pInfo->aConstraint[i].op; in sqlite3BestIndexLog()
609 pInfo->aConstraint[i].usable); in sqlite3BestIndexLog()
611 rc = sqlite3_vtab_rhs_value(pInfo, i, &pVal); in sqlite3BestIndexLog()
619 sqlite3_vtab_collation(pInfo,i), in sqlite3BestIndexLog()
620 sqlite3_vtab_in(pInfo,i,-1)); in sqlite3BestIndexLog()
645 zLogTab, iBI, pInfo->nOrderBy in sqlite3BestIndexLog()
647 for(i=0; i<pInfo->nOrderBy; i++){ in sqlite3BestIndexLog()
648 int iCol = pInfo->aOrderBy[i].iColumn; in sqlite3BestIndexLog()
654 pInfo->aOrderBy[i].desc in sqlite3BestIndexLog()
659 zLogTab, iBI, sqlite3_vtab_distinct(pInfo) in sqlite3BestIndexLog()
663 zLogTab, iBI, pInfo->colUsed in sqlite3BestIndexLog()
665 for(i=0; i<pInfo->nConstraint; i++){ in sqlite3BestIndexLog()
666 int iCol = pInfo->aConstraint[i].iColumn; in sqlite3BestIndexLog()
667 int op = pInfo->aConstraint[i].op; in sqlite3BestIndexLog()
684 pInfo->aConstraintUsage[i].argvIndex, in sqlite3BestIndexLog()
685 pInfo->aConstraintUsage[i].omit in sqlite3BestIndexLog()
690 zLogTab, iBI, pInfo->idxNum in sqlite3BestIndexLog()
694 zLogTab, iBI, pInfo->estimatedCost in sqlite3BestIndexLog()
698 zLogTab, iBI, pInfo->estimatedRows in sqlite3BestIndexLog()
700 if( pInfo->idxStr ){ in sqlite3BestIndexLog()
703 zLogTab, iBI, pInfo->idxStr in sqlite3BestIndexLog()
707 zLogTab, iBI, pInfo->needToFreeIdxStr in sqlite3BestIndexLog()
710 if( pInfo->nOrderBy ){ in sqlite3BestIndexLog()
713 zLogTab, iBI, pInfo->orderByConsumed in sqlite3BestIndexLog()
724 static int vt02BestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ in vt02BestIndex() argument
748 for(i=0; i<pInfo->nConstraint; i++){ in vt02BestIndex()
750 if( !pInfo->aConstraint[i].usable ) continue; in vt02BestIndex()
751 if( pInfo->aConstraint[i].op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; in vt02BestIndex()
752 switch( pInfo->aConstraint[i].iColumn ){ in vt02BestIndex()
754 if( sqlite3_vtab_rhs_value(pInfo, i, &pVal)==SQLITE_OK in vt02BestIndex()
762 if( sqlite3_vtab_rhs_value(pInfo, i, &pVal)==SQLITE_OK in vt02BestIndex()
775 for(i=0; i<pInfo->nConstraint; i++){ in vt02BestIndex()
776 int j = pInfo->aConstraint[i].iColumn; in vt02BestIndex()
778 if( pInfo->aConstraint[i].usable==0 in vt02BestIndex()
781 switch( pInfo->aConstraint[i].op ){ in vt02BestIndex()
801 pInfo->estimatedCost = 1; in vt02BestIndex()
802 pInfo->aConstraintUsage[isEq[0]].argvIndex = ++argvIndex; in vt02BestIndex()
803 if( flags & 0x20 ) pInfo->aConstraintUsage[isEq[0]].omit = 1; in vt02BestIndex()
804 pInfo->idxNum = 1; in vt02BestIndex()
807 pInfo->idxNum = 0; in vt02BestIndex()
808 pInfo->estimatedCost = 10000; in vt02BestIndex()
811 pInfo->aConstraintUsage[isEq[1]].argvIndex = ++argvIndex; in vt02BestIndex()
812 if( flags & 0x20 ) pInfo->aConstraintUsage[isEq[1]].omit = 1; in vt02BestIndex()
814 if( i==4 && sqlite3_vtab_in(pInfo, isEq[4], 0) ) break; in vt02BestIndex()
815 pInfo->aConstraintUsage[isEq[i]].argvIndex = ++argvIndex; in vt02BestIndex()
816 if( flags & 0x20 ) pInfo->aConstraintUsage[isEq[i]].omit = 1; in vt02BestIndex()
819 pInfo->idxNum = i; in vt02BestIndex()
820 if( isEq[4]>=0 && sqlite3_vtab_in(pInfo,isEq[4],1) ){ in vt02BestIndex()
822 pInfo->aConstraintUsage[iIn].argvIndex = ++argvIndex; in vt02BestIndex()
823 if( flags & 0x20 ) pInfo->aConstraintUsage[iIn].omit = 1; in vt02BestIndex()
826 pInfo->idxNum += 4; in vt02BestIndex()
828 pInfo->estimatedCost = v; in vt02BestIndex()
830 pInfo->estimatedRows = (sqlite3_int64)pInfo->estimatedCost; in vt02BestIndex()
837 if( pInfo->nOrderBy>0 && (flags & VT02_NO_SORT_OPT)==0 ){ in vt02BestIndex()
838 if( pInfo->idxNum==1 ){ in vt02BestIndex()
840 pInfo->orderByConsumed = 1; in vt02BestIndex()
842 if( pInfo->aOrderBy[0].iColumn<=0 in vt02BestIndex()
843 && pInfo->aOrderBy[0].desc==0 in vt02BestIndex()
846 pInfo->orderByConsumed = 1; in vt02BestIndex()
848 if( sqlite3_vtab_distinct(pInfo)>=1 ){ in vt02BestIndex()
850 for(i=0; i<pInfo->nOrderBy; i++){ in vt02BestIndex()
851 int iCol = pInfo->aOrderBy[i].iColumn; in vt02BestIndex()
855 if( sqlite3_vtab_distinct(pInfo)==2 ){ in vt02BestIndex()
858 pInfo->idxNum += 30; in vt02BestIndex()
859 pInfo->orderByConsumed = 1; in vt02BestIndex()
862 pInfo->idxNum += 20; in vt02BestIndex()
863 pInfo->orderByConsumed = 1; in vt02BestIndex()
866 pInfo->idxNum += 10; in vt02BestIndex()
867 pInfo->orderByConsumed = 1; in vt02BestIndex()
870 pInfo->orderByConsumed = 1; in vt02BestIndex()
873 pInfo->orderByConsumed = 1; in vt02BestIndex()
878 pInfo->orderByConsumed = 1; in vt02BestIndex()
881 pInfo->orderByConsumed = 1; in vt02BestIndex()
884 pInfo->orderByConsumed = 1; in vt02BestIndex()
887 pInfo->orderByConsumed = 1; in vt02BestIndex()
890 pInfo->orderByConsumed = 1; in vt02BestIndex()
897 pInfo->idxStr = sqlite3_mprintf("test"); in vt02BestIndex()
898 pInfo->needToFreeIdxStr = 1; in vt02BestIndex()
901 pInfo->idxNum += 1000; in vt02BestIndex()
905 pInfo->aConstraintUsage[iOffset].argvIndex = ++argvIndex; in vt02BestIndex()
907 && (pInfo->nOrderBy==0 || pInfo->orderByConsumed) in vt02BestIndex()
909 pInfo->aConstraintUsage[iOffset].omit = 1; in vt02BestIndex()
910 pInfo->idxNum += 100; in vt02BestIndex()
920 pInfo->aConstraintUsage[iFlagTerm].omit = 1; in vt02BestIndex()
921 pInfo->aConstraintUsage[iFlagTerm].argvIndex = ++argvIndex; in vt02BestIndex()
924 pInfo->aConstraintUsage[iLogTerm].omit = 1; in vt02BestIndex()
925 pInfo->aConstraintUsage[iLogTerm].argvIndex = ++argvIndex; in vt02BestIndex()
930 for(i=0; i<pInfo->nConstraint; i++){ in vt02BestIndex()
931 if( pInfo->aConstraint[i].usable in vt02BestIndex()
932 && pInfo->aConstraintUsage[i].argvIndex==0 in vt02BestIndex()
934 pInfo->aConstraintUsage[i].argvIndex = ++argvIndex; in vt02BestIndex()
935 if( flags & 0x20 ) pInfo->aConstraintUsage[i].omit = 1; in vt02BestIndex()
947 sqlite3BestIndexLog(pInfo, zLogTab, db, azColname, pVTab); in vt02BestIndex()