Home | History | Annotate | Download | only in dist

Lines Matching refs: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 */
42543 ** SQLITE_OK is returned if everything goes according to plan. An
60667 ** EXPLAIN QUERY PLAN.
62765 ** in a better query plan.
63788 ** binding a new value to this variable invalidates the current query plan.
63791 ** parameter in the WHERE clause might influence the choice of query plan
70738 ** by P1. The integer query plan parameter to xFilter is stored in register
71089 ** is to say when the EXPLAIN QUERY PLAN syntax is used.)
82530 ** This plan is not completely bullet-proof. It is possible for
95340 ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
95374 ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
96665 ** The implementation plan is to implement the two coroutines and seven
101999 /* If everything went according to plan, link the new VTable structure
102777 WherePlan plan; /* The lookup strategy */
102779 Bitmask used; /* Bitmask of cursors used by this plan */
104380 WhereCost *pCost /* Lowest cost query plan */
104433 nRow += sTermCost.plan.nRow;
104453 pCost->plan.nRow = nRow;
104454 pCost->plan.wsFlags = flags;
104455 pCost->plan.u.pTerm = pTerm;
104485 ** If the query plan for pSrc specified in pCost is a full table scan
104489 ** is taken into account, then alter the query plan to use the
104497 WhereCost *pCost /* Lowest cost query plan */
104514 if( (pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)!=0 ){
104545 pCost->plan.nRow = logN + 1;
104546 pCost->plan.wsFlags = WHERE_TEMP_INDEX;
104613 pLevel->plan.nEq = nColumn;
104633 pLevel->plan.wsFlags |= WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WO_EQ;
104642 pLevel->plan.u.pIdx = pIdx;
104665 assert( (u32)n==pLevel->plan.nEq );
104854 "table %s: xBestIndex returned an invalid plan", pTab->zName);
104885 WhereCost *pCost, /* Lowest cost query plan */
104902 pCost->plan.wsFlags = WHERE_VIRTUALTABLE;
105003 pCost->plan.u.pVtabIdx = pIdxInfo;
105005 pCost->plan.wsFlags |= WHERE_ORDERBY;
105007 pCost->plan.nEq = 0;
105414 ** Find the best query plan for accessing a particular table. Write the
105415 ** best query plan and its cost into the WhereCost object supplied as the
105418 ** The lowest cost plan wins. The cost is an estimate of the amount of
105432 ** named index. If no such plan is found, then the returned cost is
105433 ** SQLITE_BIG_DBL. If a plan is found that uses the named index,
105438 ** selected plan may still take advantage of the built-in rowid primary key
105449 WhereCost *pCost /* Lowest cost query plan */
105459 int wsFlagMask; /* Allowed flags in pCost->plan.wsFlag */
105875 && (cost<pCost->rCost || (cost<=pCost->rCost && nRow<pCost->plan.nRow))
105879 pCost->plan.nRow = nRow;
105880 pCost->plan.wsFlags = (wsFlags&wsFlagMask);
105881 pCost->plan.nEq = nEq;
105882 pCost->plan.u.pIdx = pIdx;
105900 pCost->plan.wsFlags |= WHERE_REVERSE;
105903 assert( pOrderBy || (pCost->plan.wsFlags&WHERE_ORDERBY)==0 );
105904 assert( pCost->plan.u.pIdx==0 || (pCost->plan.wsFlags&WHERE_ROWID_EQ)==0 );
105906 || pCost->plan.u.pIdx==0
105907 || pCost->plan.u.pIdx==pSrc->pIndex
105911 ((pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ? "none" :
105912 pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk")
105917 pCost->plan.wsFlags |= eqTermMask;
105921 ** Find the query plan for accessing table pSrc->pTab. Write the
105922 ** best query plan and its cost into the WhereCost object supplied
105933 WhereCost *pCost /* Lowest cost query plan */
106069 assert( pLevel->plan.wsFlags & WHERE_IN_ABLE );
106143 int nEq = pLevel->plan.nEq; /* The number of == or IN constraints to code */
106154 assert( pLevel->plan.wsFlags & WHERE_INDEXED );
106155 pIdx = pLevel->plan.u.pIdx;
106160 nReg = pLevel->plan.nEq + nExtraReg;
106174 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
106249 WherePlan *pPlan = &pLevel->plan;
106281 ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
106282 ** command. If the query being compiled is an EXPLAIN QUERY PLAN, a single
106295 u32 flags = pLevel->plan.wsFlags;
106306 isSearch = (pLevel->plan.nEq>0)
106326 ((flags & WHERE_TEMP_INDEX)?"": pLevel->plan.u.pIdx->zName),
106345 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
106354 nRow = (sqlite3_int64)pLevel->plan.nRow;
106397 bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0;
106398 omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0
106425 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
106430 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
106468 if( pLevel->plan.wsFlags & WHERE_ROWID_EQ ){
106488 }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){
106565 }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){
106612 int nEq = pLevel->plan.nEq; /* Number of == or IN terms */
106629 pIdx = pLevel->plan.u.pIdx;
106642 && (pLevel->plan.wsFlags&WHERE_ORDERBY)
106654 if( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ){
106658 if( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ){
106776 testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT );
106777 testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT );
106778 if( (pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 ){
106797 if( pLevel->plan.wsFlags & WHERE_UNIQUE ){
106808 if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){
106860 pTerm = pLevel->plan.u.pTerm;
107055 ** The following variable holds a text description of query plan generated
107081 if( pWInfo->a[i].plan.wsFlags & WHERE_TEMP_INDEX ){
107082 Index *pIdx = pWInfo->a[i].plan.u.pIdx;
107348 WhereCost bestPlan; /* Most efficient plan seen so far */
107374 ** its query plan, then checking to see if that query plan uses any
107376 ** used then the "optimal" query plan works.
107390 ** cost. However, this meant that SQLite could select the wrong plan
107442 /* If an INDEXED BY clause is present, then the plan must use that
107445 || (sCost.plan
107446 || sCost.plan.u.pIdx==pTabItem->pIndex );
107448 if( isOptimal && (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ){
107457 ** (2) A full-table-scan plan cannot supercede indexed plan unless
107458 ** the full-table-scan is an "optimal" plan as defined above.
107469 ** (4) The plan cost must be lower than prior plans or else the
107474 || (bestPlan.plan.wsFlags & WHERE_NOT_FULLSCAN)==0
107475 || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0)
107477 || NEVER((sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0))
107480 && sCost.plan.nRow<bestPlan.plan.nRow))
107484 j, sCost.rCost, sCost.plan.nRow));
107495 bestJ, pLevel-pWInfo->a, bestPlan.rCost, bestPlan.plan.nRow));
107497 if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 && ALWAYS(ppOrderBy) ){
107500 if( (bestPlan.plan.wsFlags & WHERE_DISTINCT)!=0 ){
107504 andFlags &= bestPlan.plan.wsFlags;
107505 pLevel->plan = bestPlan.plan;
107506 testcase( bestPlan.plan.wsFlags & WHERE_INDEXED );
107507 testcase( bestPlan.plan.wsFlags & WHERE_TEMP_INDEX );
107508 if( bestPlan.plan.wsFlags & (WHERE_INDEXED|WHERE_TEMP_INDEX) ){
107515 if( bestPlan.plan.nRow>=(double)1 ){
107516 pParse->nQueryLoop *= bestPlan.plan.nRow;
107526 if( (bestPlan.plan.wsFlags & WHERE_INDEXED)==0 ){
107533 assert( bestPlan.plan.u.pIdx==pIdx );
107557 pWInfo->a[0].plan.wsFlags &= ~WHERE_IDX_ONLY;
107573 pWInfo->nRowOut *= pLevel->plan.nRow;
107579 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
107585 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107603 if( (pLevel->plan.wsFlags & WHERE_TEMP_INDEX)!=0 ){
107607 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
107608 Index *pIx = pLevel->plan.u.pIdx;
107636 /* Record in the query plan information about the current table
107651 if( pLevel->plan.wsFlags & WHERE_IDX_ONLY ){
107660 testcase( pLevel->plan.wsFlags & WHERE_ROWID_EQ );
107661 testcase( pLevel->plan.wsFlags & WHERE_ROWID_RANGE );
107662 if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
107665 }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
107666 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
107668 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
107720 if( pLevel->plan.wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){
107735 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107736 || (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 );
107737 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){
107768 int ws = pLevel->plan.wsFlags;
107790 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 && !db->mallocFailed){
107793 Index *pIdx = pLevel->plan.u.pIdx;
107808 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
108605 26, /* PLAN => ID */
108747 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
108823 /* 7 */ "explain ::= EXPLAIN QUERY PLAN",
109922 case 7: /* explain ::= EXPLAIN QUERY PLAN */
111577 testcase( i==73 ); /* PLAN */