Home | History | Annotate | Download | only in dist

Lines Matching defs:plan

3150 ** WHERE clause might influence the choice of query plan for a statement,
3155 ** choice of query plan if the parameter is the left-hand side of a [LIKE]
10036 WherePlan plan; /* query plan for this element of the FROM clause */
10047 union { /* Information that depends on plan.wsFlags */
10054 } in; /* Used when plan.wsFlags&WHERE_IN_ABLE */
38860 ** SQLITE_OK is returned if everything goes according to plan. An
56369 ** EXPLAIN QUERY PLAN.
58465 ** in a better query plan.
59457 ** binding a new value to this variable invalidates the current query plan.
59460 ** parameter in the WHERE clause might influence the choice of query plan
66058 ** by P1. The integer query plan parameter to xFilter is stored in register
66390 ** is to say when the EXPLAIN QUERY PLAN syntax is used.)
76124 ** This plan is not completely bullet-proof. It is possible for
88639 ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
88657 ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
89938 ** The implementation plan is to implement the two coroutines and seven
95067 /* If everything went according to plan, link the new VTable structure
95718 WherePlan plan; /* The lookup strategy */
95720 Bitmask used; /* Bitmask of cursors used by this plan */
97101 WhereCost *pCost /* Lowest cost query plan */
97149 nRow += sTermCost.plan.nRow;
97169 pCost->plan.nRow = nRow;
97170 pCost->plan.wsFlags = flags;
97171 pCost->plan.u.pTerm = pTerm;
97201 ** If the query plan for pSrc specified in pCost is a full table scan
97205 ** is taken into account, then alter the query plan to use the
97213 WhereCost *pCost /* Lowest cost query plan */
97226 if( (pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)!=0 ){
97253 pCost->plan.nRow = logN + 1;
97254 pCost->plan.wsFlags = WHERE_TEMP_INDEX;
97324 pLevel->plan.nEq = nColumn;
97344 pLevel->plan.wsFlags |= WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WO_EQ;
97353 pLevel->plan.u.pIdx = pIdx;
97376 assert( (u32)n==pLevel->plan.nEq );
97563 "table %s: xBestIndex returned an invalid plan", pTab->zName);
97594 WhereCost *pCost, /* Lowest cost query plan */
97611 pCost->plan.wsFlags = WHERE_VIRTUALTABLE;
97712 pCost->plan.u.pVtabIdx = pIdxInfo;
97714 pCost->plan.wsFlags |= WHERE_ORDERBY;
97716 pCost->plan.nEq = 0;
97971 ** Find the query plan for accessing a particular table. Write the
97972 ** best query plan and its cost into the WhereCost object supplied as the
97975 ** The lowest cost plan wins. The cost is an estimate of the amount of
97976 ** CPU and disk I/O need to process the request using the selected plan.
97989 ** named index. If no such plan is found, then the returned cost is
97990 ** SQLITE_BIG_DBL. If a plan is found that uses the named index,
97995 ** selected plan may still take advantage of the tables built-in rowid
98005 WhereCost *pCost /* Lowest cost query plan */
98015 int wsFlagMask; /* Allowed flags in pCost->plan.wsFlag */
98325 && (cost<pCost->rCost || (cost<=pCost->rCost && nRow<pCost->plan.nRow))
98329 pCost->plan.nRow = nRow;
98330 pCost->plan.wsFlags = (wsFlags&wsFlagMask);
98331 pCost->plan.nEq = nEq;
98332 pCost->plan.u.pIdx = pIdx;
98350 pCost->plan.wsFlags |= WHERE_REVERSE;
98353 assert( pOrderBy || (pCost->plan.wsFlags&WHERE_ORDERBY)==0 );
98354 assert( pCost->plan.u.pIdx==0 || (pCost->plan.wsFlags&WHERE_ROWID_EQ)==0 );
98356 || pCost->plan.u.pIdx==0
98357 || pCost->plan.u.pIdx==pSrc->pIndex
98361 ((pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ? "none" :
98362 pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk")
98367 pCost->plan.wsFlags |= eqTermMask;
98371 ** Find the query plan for accessing table pSrc->pTab. Write the
98372 ** best query plan and its cost into the WhereCost object supplied
98383 WhereCost *pCost /* Lowest cost query plan */
98519 assert( pLevel->plan.wsFlags & WHERE_IN_ABLE );
98593 int nEq = pLevel->plan.nEq; /* The number of == or IN constraints to code */
98604 assert( pLevel->plan.wsFlags & WHERE_INDEXED );
98605 pIdx = pLevel->plan.u.pIdx;
98610 nReg = pLevel->plan.nEq + nExtraReg;
98624 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
98699 WherePlan *pPlan = &pLevel->plan;
98729 ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
98730 ** command. If the query being compiled is an EXPLAIN QUERY PLAN, a single
98743 u32 flags = pLevel->plan.wsFlags;
98754 isSearch = (pLevel->plan.nEq>0)
98774 ((flags & WHERE_TEMP_INDEX)?"": pLevel->plan.u.pIdx->zName),
98793 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
98802 nRow = (sqlite3_int64)pLevel->plan.nRow;
98845 bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0;
98846 omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0
98873 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
98878 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
98916 if( pLevel->plan.wsFlags & WHERE_ROWID_EQ ){
98936 }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){
99013 }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){
99060 int nEq = pLevel->plan.nEq; /* Number of == or IN terms */
99077 pIdx = pLevel->plan.u.pIdx;
99090 && (pLevel->plan.wsFlags&WHERE_ORDERBY)
99102 if( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ){
99106 if( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ){
99218 testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT );
99219 testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT );
99220 if( (pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 ){
99244 if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){
99296 pTerm = pLevel->plan.u.pTerm;
99460 ** The following variable holds a text description of query plan generated
99486 if( pWInfo->a[i].plan.wsFlags & WHERE_TEMP_INDEX ){
99487 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
99741 WhereCost bestPlan; /* Most efficient plan seen so far */
99767 ** its query plan, then checking to see if that query plan uses any
99769 ** used then the "optimal" query plan works.
99783 ** cost. However, this meant that SQLite could select the wrong plan
99833 /* If an INDEXED BY clause is present, then the plan must use that
99836 || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0
99837 || sCost.plan.u.pIdx==pTabItem->pIndex );
99839 if( isOptimal && (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ){
99848 ** (2) A full-table-scan plan cannot supercede another plan unless
99849 ** it is an "optimal" plan as defined above.
99860 ** (4) The plan cost must be lower than prior plans or else the
99865 || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0)
99867 || NEVER((sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0))
99870 && sCost.plan.nRow<bestPlan.plan.nRow))
99874 j, sCost.rCost, sCost.plan.nRow));
99885 bestJ, pLevel-pWInfo->a, bestPlan.rCost, bestPlan.plan.nRow));
99886 if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){
99889 andFlags &= bestPlan.plan.wsFlags;
99890 pLevel->plan = bestPlan.plan;
99891 testcase( bestPlan.plan.wsFlags & WHERE_INDEXED );
99892 testcase( bestPlan.plan.wsFlags & WHERE_TEMP_INDEX );
99893 if( bestPlan.plan.wsFlags & (WHERE_INDEXED|WHERE_TEMP_INDEX) ){
99900 if( bestPlan.plan.nRow>=(double)1 ){
99901 pParse->nQueryLoop *= bestPlan.plan.nRow;
99911 if( (bestPlan.plan.wsFlags & WHERE_INDEXED)==0 ){
99918 assert( bestPlan.plan.u.pIdx==pIdx );
99942 pWInfo->a[0].plan.wsFlags &= ~WHERE_IDX_ONLY;
99958 pWInfo->nRowOut *= pLevel->plan.nRow;
99964 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
99970 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
99988 if( (pLevel->plan.wsFlags & WHERE_TEMP_INDEX)!=0 ){
99992 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
99993 Index *pIx = pLevel->plan.u.pIdx;
100021 /* Record in the query plan information about the current table
100036 if( pLevel->plan.wsFlags & WHERE_IDX_ONLY ){
100045 testcase( pLevel->plan.wsFlags & WHERE_ROWID_EQ );
100046 testcase( pLevel->plan.wsFlags & WHERE_ROWID_RANGE );
100047 if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
100050 }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
100051 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
100053 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
100105 if( pLevel->plan.wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){
100120 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
100121 || (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 );
100122 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){
100153 int ws = pLevel->plan.wsFlags;
100175 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 && !db->mallocFailed){
100178 Index *pIdx = pLevel->plan.u.pIdx;
100193 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
100977 26, /* PLAN => ID */
101118 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
101194 PLAN",
102292 case 7: /* explain ::= EXPLAIN QUERY PLAN */
103918 testcase( i==73 ); /* PLAN */