Lines Matching full:plan
2946 ** change the query plan for a statement, then the statement may be
9382 WherePlan plan; /* query plan for this element of the FROM clause */
9393 union { /* Information that depends on plan.wsFlags */
9400 } in; /* Used when plan
35376 ** SQLITE_OK is returned if everything goes according to plan.
48473 ** EXPLAIN QUERY PLAN.
50526 ** in a better query plan.
51486 ** binding a new value to this variable invalidates the current query plan.
57868 ** by P1. The integer query plan parameter to xFilter is stored in register
58192 ** is to say when the EXPLAIN QUERY PLAN syntax is used.)
67768 ** This plan is not completely bullet-proof. It is possible for
81246 ** The implementation plan is to implement the two coroutines and seven
86297 /* If everything went according to plan, link the new VTable structure
86947 WherePlan plan; /* The lookup strategy */
86950 Bitmask used; /* Bitmask of cursors used by this plan */
88321 WhereCost *pCost /* Lowest cost query plan */
88383 pCost->plan.wsFlags = flags;
88384 pCost->plan.u.pTerm = pTerm;
88535 "table %s: xBestIndex returned an invalid plan", pTab->zName);
88565 WhereCost *pCost, /* Lowest cost query plan */
88581 pCost->plan.wsFlags = WHERE_VIRTUALTABLE;
88673 pCost->plan.u.pVtabIdx = pIdxInfo;
88675 pCost->plan.wsFlags |= WHERE_ORDERBY;
88677 pCost->plan.nEq = 0;
88933 ** Find the query plan for accessing a particular table. Write the
88934 ** best query plan and its cost into the WhereCost object supplied as the
88937 ** The lowest cost plan wins. The cost is an estimate of the amount of
88938 ** CPU and disk I/O need to process the request using the selected plan.
88951 ** named index. If no such plan is found, then the returned cost is
88952 ** SQLITE_BIG_DBL. If a plan is found that uses the named index,
88957 ** selected plan may still take advantage of the tables built-in rowid
88966 WhereCost *pCost /* Lowest cost query plan */
88976 int wsFlagMask; /* Allowed flags in pCost->plan.wsFlag */
89240 pCost->plan.wsFlags = (wsFlags&wsFlagMask);
89241 pCost->plan.nEq = nEq;
89242 pCost->plan.u.pIdx = pIdx;
89260 pCost->plan.wsFlags |= WHERE_REVERSE;
89263 assert( pOrderBy || (pCost->plan.wsFlags&WHERE_ORDERBY)==0 );
89264 assert( pCost->plan.u.pIdx==0 || (pCost->plan.wsFlags&WHERE_ROWID_EQ)==0 );
89266 || pCost->plan.u.pIdx==0
89267 || pCost->plan.u.pIdx==pSrc->pIndex
89271 (pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk")
89275 pCost->plan.wsFlags |= eqTermMask;
89279 ** Find the query plan for accessing table pSrc->pTab. Write the
89280 ** best query plan and its cost into the WhereCost object supplied
89290 WhereCost *pCost /* Lowest cost query plan */
89423 assert( pLevel->plan.wsFlags & WHERE_IN_ABLE );
89497 int nEq = pLevel->plan.nEq; /* The number of == or IN constraints to code */
89508 assert( pLevel->plan.wsFlags & WHERE_INDEXED );
89509 pIdx = pLevel->plan.u.pIdx;
89514 nReg = pLevel->plan.nEq + nExtraReg;
89528 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
89591 bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0;
89592 omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0
89619 plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
89624 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
89662 if( pLevel->plan.wsFlags & WHERE_ROWID_EQ ){
89681 }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){
89752 }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){
89799 int nEq = pLevel->plan.nEq;
89815 pIdx = pLevel->plan.u.pIdx;
89828 && (pLevel->plan.wsFlags&WHERE_ORDERBY)
89840 if( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ){
89844 if( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ){
89952 testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT );
89953 testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT );
89954 if( pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) ){
89978 if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){
90030 pTerm = pLevel->plan.u.pTerm;
90187 ** The following variable holds a text description of query plan generated
90457 WhereCost bestPlan; /* Most efficient plan seen so far */
90485 ** cost. However, this meant that SQLite could select the wrong plan
90541 if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){
90544 andFlags &= bestPlan.plan.wsFlags;
90545 pLevel->plan = bestPlan.plan;
90546 if( bestPlan.plan.wsFlags & WHERE_INDEXED ){
90561 if( (bestPlan.plan.wsFlags & WHERE_INDEXED)==0 ){
90568 assert( bestPlan.plan.u.pIdx==pIdx );
90592 pWInfo->a[0].plan.wsFlags &= ~WHERE_IDX_ONLY;
90611 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
90613 zMsg, pLevel->plan.u.pIdx->zName);
90614 }else if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){
90616 }else if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
90620 else if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
90621 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
90626 if( pLevel->plan.wsFlags & WHERE_ORDERBY ){
90637 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
90643 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
90659 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
90660 Index *pIx = pLevel->plan.u.pIdx;
90684 /* Record in the query plan information about the current table
90699 if( pLevel->plan.wsFlags & WHERE_IDX_ONLY ){
90708 testcase( pLevel->plan.wsFlags & WHERE_ROWID_EQ );
90709 testcase( pLevel->plan.wsFlags & WHERE_ROWID_RANGE );
90710 if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
90713 }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
90714 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
90716 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
90765 if( pLevel->plan.wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){
90780 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
90781 || (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 );
90782 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){
90811 if( !pWInfo->okOnePass && (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){
90814 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
90832 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 && !db->mallocFailed){
90835 Index *pIdx = pLevel->plan.u.pIdx;
90850 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
91632 26, /* PLAN => ID */
91773 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
91850 /* 7 */ "explain ::= EXPLAIN QUERY PLAN",
92951 case 7: /* explain ::= EXPLAIN QUERY PLAN */
94558 testcase( i==73 ); /* PLAN */