Lines Matching defs:WhereLoop

110489 typedef struct WhereLoop WhereLoop;
110501 ** Contrast this object with WhereLoop. This object describes the
110502 ** implementation of the loop. WhereLoop describes the algorithm.
110503 ** This object contains a pointer to the WhereLoop algorithm as one of
110536 struct WhereLoop *pWLoop; /* The selected WhereLoop object */
110543 ** one corresponding WhereLoop object (unless INDEXED BY constraints
110545 ** FROM clause will have multiple WhereLoop objects, each describing a
110549 ** Query planning consists of building up a collection of these WhereLoop
110550 ** objects, then computing a particular sequence of WhereLoop objects, with
110551 ** one WhereLoop object per FROM clause term, that satisfy all dependencies
110554 struct WhereLoop {
110582 # define WHERE_LOOP_XFER_SZ offsetof(WhereLoop,nLSlot)
110585 WhereLoop *pNextLoop; /* Next WhereLoop object in the WhereClause */
110611 static int whereLoopResize(sqlite3*, WhereLoop*, int);
110614 ** Each instance of this object holds a sequence of WhereLoop objects
110617 ** Think of each WhereLoop object as a node in a graph with arcs
110619 ** not a completely accurate description because WhereLoop costs are a
110623 ** or all of the WhereLoop objects once.
110632 Bitmask maskLoop; /* Bitmask of all WhereLoop objects in this path */
110638 WhereLoop **aLoop; /* Array of WhereLoop objects implementing this path */
110818 ** to construct WhereLoop objects for a particular query.
110824 WhereLoop *pNew; /* Template WhereLoop */
110847 WhereLoop *pLoops; /* List of all WhereLoop objects */
110890 ** These are definitions of bits in the WhereLoop.wsFlags field.
110891 ** The particular combination of bits in each WhereLoop help to
110892 ** determine the algorithm that WhereLoop represents.
110904 #define WHERE_INDEXED 0x00000200 /* WhereLoop.u.btree.pIndex is valid */
110905 #define WHERE_VIRTUALTABLE 0x00000400 /* WhereLoop.u.vtab is valid */
112488 WhereLoop *pLoop; /* The Loop object */
112935 WhereLoop *pLoop, /* Update the .nOut value of this loop */
113049 WhereLoop *pLoop /* Modify the .nOut and maybe .rRun fields */
113407 WhereLoop *pLoop = pLevel->pWLoop;
113514 WhereLoop *pLoop; /* The WhereLoop object */
113640 static char *explainIndexRange(sqlite3 *db, WhereLoop *pLoop, Table *pTab){
113704 WhereLoop *pLoop; /* The controlling WhereLoop object */
113786 WhereLoop *pLoop; /* The WhereLoop object being coded */
114433 WhereLoop *pSubLoop;
114666 ** Print a WhereLoop object for debugging purposes
114668 static void whereLoopPrint(WhereLoop *p, WhereClause *pWC){
114704 ** expressions in the WhereLoop.aLTerm[] array.
114727 ** Convert bulk memory into a valid WhereLoop that can be passed
114730 static void whereLoopInit(WhereLoop *p){
114738 ** Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact.
114740 static void whereLoopClearUnion(sqlite3 *db, WhereLoop *p){
114756 ** Deallocate internal memory used by a WhereLoop object
114758 static void whereLoopClear(sqlite3 *db, WhereLoop *p){
114767 static int whereLoopResize(sqlite3 *db, WhereLoop *p, int n){
114783 static int whereLoopXfer(sqlite3 *db, WhereLoop *pTo, WhereLoop *pFrom){
114800 ** Delete a WhereLoop object
114802 static void whereLoopDelete(sqlite3 *db, WhereLoop *p){
114814 WhereLoop *p = pWInfo->pLoops;
114837 const WhereLoop *pX, /* First WhereLoop to compare */
114838 const WhereLoop *pY /* Compare against this WhereLoop */
114856 ** Try to adjust the cost of WhereLoop pTemplate upwards or downwards so
114865 ** To say "WhereLoop X is a proper subset of Y" means that X uses fewer
114870 ** WhereLoop.nLTerm field is not an accurate measure of the number of WHERE
114880 static void whereLoopAdjustCost(const WhereLoop *p, WhereLoop *pTemplate){
114905 ** Return NULL if the WhereLoop list contains an entry that can supplant
114908 ** If pX is a WhereLoop that pTemplate can supplant, then return the
114914 static WhereLoop **whereLoopFindLesser(
114915 WhereLoop **ppPrev,
114916 const WhereLoop *pTemplate
114918 WhereLoop *p;
114921 /* If either the iTab or iSortIdx values for two WhereLoop are different
114948 /* If existing WhereLoop p is better than pTemplate, pTemplate can be
114949 ** discarded. WhereLoop p is better if:
114978 ** Insert or replace a WhereLoop entry using the template supplied.
114980 ** An existing WhereLoop entry might be overwritten if the new template
114982 ** and no insert will occur if an existing WhereLoop is faster and has
114983 ** fewer dependencies than the template. Otherwise a new WhereLoop is
115001 static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
115002 WhereLoop **ppPrev, *p;
115025 /* Look for an existing WhereLoop to replace with pTemplate
115031 /* There already exists a WhereLoop on the list that is better
115046 ** WhereLoop and insert it.
115059 /* Allocate a new WhereLoop to add to the end of the list */
115060 *ppPrev = p = sqlite3DbMallocRaw(db, sizeof(WhereLoop));
115065 /* We will be overwriting WhereLoop p[]. But before we do, first
115068 WhereLoop **ppTail = &p->pNextLoop;
115069 WhereLoop *pToDel;
115096 ** Adjust the WhereLoop.nOut value downward to account for terms of the
115104 static void whereLoopOutputAdjust(WhereClause *pWC, WhereLoop *pLoop){
115151 WhereLoopBuilder *pBuilder, /* The WhereLoop factory */
115159 WhereLoop *pNew; /* Template WhereLoop under construction */
115459 ** Add all WhereLoop objects for a single table of the join where the table
115463 ** The costs (WhereLoop.rRun) of the b-tree loops added by this function
115505 WhereLoop *pNew; /* Template WhereLoop object */
115682 ** Add all WhereLoop objects for a table of the join identified by
115705 WhereLoop *pNew;
115850 ** Add WhereLoop entries to handle OR terms. This works for either
115856 WhereLoop *pNew;
115959 ** Add all WhereLoop objects for all tables
115972 WhereLoop *pNew;
116000 ** Examine a WherePath (with the addition of the extra WhereLoop of the 5th
116022 WhereLoop *pLast, /* Add this WhereLoop to the end of pPath->aLoop[] */
116034 int iLoop; /* Index of WhereLoop in pPath being processed */
116036 int iCur; /* Cursor number for current WhereLoop */
116038 WhereLoop *pLoop = 0; /* Current WhereLoop being processed. */
116050 ** We say the WhereLoop is "one-row" if it generates no more than one
116051 ** row of output. A WhereLoop is one-row if all of the following are true:
116054 ** Any WhereLoop with an WHERE_COLUMN_EQ constraint on the rowid is one-row.
116055 ** Every one-row WhereLoop will have the WHERE_ONEROW bit set in wsFlags.
116057 ** We say the WhereLoop is "order-distinct" if the set of columns from
116058 ** that WhereLoop that are in the ORDER BY clause are different for every
116059 ** row of the WhereLoop. Every one-row WhereLoop is automatically
116060 ** order-distinct. A WhereLoop that has no columns in the ORDER BY clause
116067 ** rowid appears in the ORDER BY clause, the corresponding WhereLoop is
116164 ** WhereLoop is not well-ordered
116287 static const char *wherePathName(WherePath *pPath, int nLoop, WhereLoop *pLast){
116337 ** Given the list of WhereLoop objects at pWInfo->pLoops, this routine
116338 ** attempts to find the lowest cost path that visits each WhereLoop
116364 WhereLoop *pWLoop; /* One of the WhereLoop objects */
116365 WhereLoop **pX; /* Used to divy up the pSpace memory */
116392 nSpace = (sizeof(WherePath)+sizeof(WhereLoop*)*nLoop)*mxChoice*2;
116399 pX = (WhereLoop**)(aFrom+mxChoice);
116575 memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop);
116694 WhereLoop *pLoop;
116866 WhereLoopBuilder sWLB; /* The WhereLoop builder */
116869 WhereLoop *pLoop; /* Pointer to a single WhereLoop object */
116914 pWInfo = sqlite3DbMallocZero(db, nByteWInfo + sizeof(WhereLoop));
116932 sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
117017 /* Construct the WhereLoop objects */
117040 /* Display all of the WhereLoop objects if wheretrace is enabled */
117043 WhereLoop *p;
117275 WhereLoop *pLoop;