Home | History | Annotate | Download | only in orig

Lines Matching full:plan

3495 ** WHERE clause might influence the choice of query plan for a statement,
3500 ** choice of query plan if the parameter is the left-hand side of a [LIKE]
10817 WherePlan plan; /* query plan for this element of the FROM clause */
10828 union { /* Information that depends on plan.wsFlags */
10835 } in; /* Used when plan.wsFlags&WHERE_IN_ABLE */
42515 ** SQLITE_OK is returned if everything goes according to plan. An
60639 ** EXPLAIN QUERY PLAN.
62737 ** in a better query plan.
63760 ** binding a new value to this variable invalidates the current query plan.
63763 ** parameter in the WHERE clause might influence the choice of query plan
70710 ** by P1. The integer query plan parameter to xFilter is stored in register
71061 ** is to say when the EXPLAIN QUERY PLAN syntax is used.)
82494 ** This plan is not completely bullet-proof. It is possible for
95304 ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
95338 ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
96629 ** The implementation plan is to implement the two coroutines and seven
101963 /* If everything went according to plan, link the new VTable structure
102741 WherePlan plan; /* The lookup strategy */
102743 Bitmask used; /* Bitmask of cursors used by this plan */
104344 WhereCost *pCost /* Lowest cost query plan */
104397 nRow += sTermCost.plan.nRow;
104417 pCost->plan.nRow = nRow;
104418 pCost->plan.wsFlags = flags;
104419 pCost->plan.u.pTerm = pTerm;
104449 ** If the query plan for pSrc specified in pCost is a full table scan
104453 ** is taken into account, then alter the query plan to use the
104461 WhereCost *pCost /* Lowest cost query plan */
104478 if( (pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)!=0 ){
104509 pCost->plan.nRow = logN + 1;
104510 pCost->plan.wsFlags = WHERE_TEMP_INDEX;
104577 pLevel->plan.nEq = nColumn;
104597 pLevel->plan.wsFlags |= WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WO_EQ;
104606 pLevel->plan.u.pIdx = pIdx;
104629 assert( (u32)n==pLevel->plan.nEq );
104818 "table %s: xBestIndex returned an invalid plan", pTab->zName);
104849 WhereCost *pCost, /* Lowest cost query plan */
104866 pCost->plan.wsFlags = WHERE_VIRTUALTABLE;
104967 pCost->plan.u.pVtabIdx = pIdxInfo;
104969 pCost->plan.wsFlags |= WHERE_ORDERBY;
104971 pCost->plan.nEq = 0;
105378 ** Find the best query plan for accessing a particular table. Write the
105379 ** best query plan and its cost into the WhereCost object supplied as the
105382 ** The lowest cost plan wins. The cost is an estimate of the amount of
105396 ** named index. If no such plan is found, then the returned cost is
105397 ** SQLITE_BIG_DBL. If a plan is found that uses the named index,
105402 ** selected plan may still take advantage of the built-in rowid primary key
105413 WhereCost *pCost /* Lowest cost query plan */
105423 int wsFlagMask; /* Allowed flags in pCost->plan.wsFlag */
105839 && (cost<pCost->rCost || (cost<=pCost->rCost && nRow<pCost->plan.nRow))
105843 pCost->plan.nRow = nRow;
105844 pCost->plan.wsFlags = (wsFlags&wsFlagMask);
105845 pCost->plan.nEq = nEq;
105846 pCost->plan.u.pIdx = pIdx;
105864 pCost->plan.wsFlags |= WHERE_REVERSE;
105867 assert( pOrderBy || (pCost->plan.wsFlags&WHERE_ORDERBY)==0 );
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
105875 ((pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ? "none" :
105876 pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk")
105881 pCost->plan.wsFlags |= eqTermMask;
105885 ** Find the query plan for accessing table pSrc->pTab. Write the
105886 ** best query plan and its cost into the WhereCost object supplied
105897 WhereCost *pCost /* Lowest cost query plan */
106033 assert( pLevel->plan.wsFlags & WHERE_IN_ABLE );
106107 int nEq = pLevel->plan.nEq; /* The number of == or IN constraints to code */
106118 assert( pLevel->plan.wsFlags & WHERE_INDEXED );
106119 pIdx = pLevel->plan.u.pIdx;
106124 nReg = pLevel->plan.nEq + nExtraReg;
106138 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
106213 WherePlan *pPlan = &pLevel->plan;
106245 ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
106246 ** command. If the query being compiled is an EXPLAIN QUERY PLAN, a single
106259 u32 flags = pLevel->plan.wsFlags;
106270 isSearch = (pLevel->plan.nEq>0)
106290 ((flags & WHERE_TEMP_INDEX)?"": pLevel->plan.u.pIdx->zName),
106309 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
106318 nRow = (sqlite3_int64)pLevel->plan.nRow;
106361 bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0;
106362 omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0
106389 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
106394 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
106432 if( pLevel->plan.wsFlags & WHERE_ROWID_EQ ){
106452 }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){
106529 }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){
106576 int nEq = pLevel->plan.nEq; /* Number of == or IN terms */
106593 pIdx = pLevel->plan.u.pIdx;
106606 && (pLevel->plan.wsFlags&WHERE_ORDERBY)
106618 if( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ){
106622 if( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ){
106740 testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT );
106741 testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT );
106742 if( (pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 ){
106761 if( pLevel->plan.wsFlags & WHERE_UNIQUE ){
106772 if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){
106824 pTerm = pLevel->plan.u.pTerm;
107019 ** The following variable holds a text description of query plan generated
107045 if( pWInfo->a[i].plan.wsFlags & WHERE_TEMP_INDEX ){
107046 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
107312 WhereCost bestPlan; /* Most efficient plan seen so far */
107338 ** its query plan, then checking to see if that query plan uses any
107340 ** used then the "optimal" query plan works.
107354 ** cost. However, this meant that SQLite could select the wrong plan
107406 /* If an INDEXED BY clause is present, then the plan must use that
107409 || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0
107410 || sCost.plan.u.pIdx==pTabItem->pIndex );
107412 if( isOptimal && (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ){
107421 ** (2) A full-table-scan plan cannot supercede indexed plan unless
107422 ** the full-table-scan is an "optimal" plan as defined above.
107433 ** (4) The plan cost must be lower than prior plans or else the
107438 || (bestPlan.plan.wsFlags & WHERE_NOT_FULLSCAN)==0
107439 || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0)
107441 || NEVER((sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0))
107444 && sCost.plan.nRow<bestPlan.plan.nRow))
107448 j, sCost.rCost, sCost.plan.nRow));
107459 bestJ, pLevel-pWInfo->a, bestPlan.rCost, bestPlan.plan.nRow));
107461 if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 && ALWAYS(ppOrderBy) ){
107464 if( (bestPlan.plan.wsFlags & WHERE_DISTINCT)!=0 ){
107468 andFlags &= bestPlan.plan.wsFlags;
107469 pLevel->plan = bestPlan.plan;
107470 testcase( bestPlan.plan.wsFlags & WHERE_INDEXED );
107471 testcase( bestPlan.plan.wsFlags & WHERE_TEMP_INDEX );
107472 if( bestPlan.plan.wsFlags & (WHERE_INDEXED|WHERE_TEMP_INDEX) ){
107479 if( bestPlan.plan.nRow>=(double)1 ){
107480 pParse->nQueryLoop *= bestPlan.plan.nRow;
107490 if( (bestPlan.plan.wsFlags & WHERE_INDEXED)==0 ){
107497 assert( bestPlan.plan.u.pIdx==pIdx );
107521 pWInfo->a[0].plan.wsFlags &= ~WHERE_IDX_ONLY;
107537 pWInfo->nRowOut *= pLevel->plan.nRow;
107543 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
107549 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107567 if( (pLevel->plan.wsFlags & WHERE_TEMP_INDEX)!=0 ){
107571 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
107572 Index *pIx = pLevel->plan.u.pIdx;
107600 /* Record in the query plan information about the current table
107615 if( pLevel->plan.wsFlags & WHERE_IDX_ONLY ){
107624 testcase( pLevel->plan.wsFlags & WHERE_ROWID_EQ );
107625 testcase( pLevel->plan.wsFlags & WHERE_ROWID_RANGE );
107626 if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
107629 }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
107630 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
107632 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
107684 if( pLevel->plan.wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){
107699 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107700 || (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 );
107701 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){
107732 int ws = pLevel->plan.wsFlags;
107754 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 && !db->mallocFailed){
107757 Index *pIdx = pLevel->plan.u.pIdx;
107772 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
108569 26, /* PLAN => ID */
108711 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
108787 /* 7 */ "explain ::= EXPLAIN QUERY PLAN",
109886 case 7: /* explain ::= EXPLAIN QUERY PLAN */
111541 testcase( i==73 ); /* PLAN */