Lines Matching defs:scan

7464 ** required by the current scan. Virtual table columns are numbered from
7498 ** to a linear scan of an SQLite table with N rows. A cost of log(N)
8894 ** that the prepared statement is using a full table scan rather than
8921 ** a table as part of a full table scan. Large numbers for this counter
10699 ** This function attempts to scan the WAL file associated with database zDb
18107 unsigned noSkipScan:1; /* Do not try to use skip-scan if true */
22171 # error "Compile-time disabling of covering index scan using the\
54192 ** Only scan those hash slots that might contain pages that need to
54199 ** It is necessary to scan the entire hash table */
63482 ** reader has to scan the entire WAL looking for page P frames. If the
63483 ** WAL is large (multiple megabytes is typical) that scan can be slow,
76950 ** This helps to keep entries in the disk file in order so that a scan
76951 ** of the table is closer to a linear scan through the file. That in turn
79320 int bCkFreelist = 1; /* True to scan the freelist */
83065 ** the label is resolved to a specific address, the VDBE will scan
90285 ** Various scripts scan this source file in order to generate HTML
91231 ** Formatting is important to scripts that scan this file.
100492 ** Initialize PmaReader pReadr to scan through the PMA stored in file pFile
104991 ExprList *pEList, /* List of expressions to scan */
107363 ** gatherSelectWindowsCallback() are used to scan all the expressions
114891 int nLimit; /* Analysis row-scan limit */
114990 ** L: A limit on the number of rows to scan, or 0 for no-limit
123876 SrcList *pSrc, /* the FROM clause -- which tables to scan */
127683 Expr *pWhere = 0; /* WHERE clause to scan with */
128129 ** foreign key, then omit this scan altogether. As all child key
135496 ** the initialization scan.
137105 pragmaVtabFilter, /* xFilter - configure scan constraints */
138335 SrcList *pSrc, /* the FROM clause -- which tables to scan */
139618 ** memory cells and break out of the scan loop.
141507 ** of the scan loop. Note that the select might return multiple columns
142127 ExprList *pList /* List to scan and in which to make substitutes */
142326 ** but only has to scan the data once. And because indices might
142327 ** exist on the table t1, a complete scan of the data might be
142768 ** will scan expressions looking for iParent references and replace
144639 Index *pIdx /* Index used to optimize scan, or NULL */
145500 /* Begin the database scan. */
145555 /* End the database scan loop.
145978 const int iCsr = pParse->nTab++; /* Cursor to scan b-tree */
145987 /* Search for the index that has the lowest scan cost.
145989 ** (2011-04-15) Do not do a full scan of an unordered index.
148566 /* Begin the database scan.
148571 ** things might disturb a cursor being used to scan through the table
148581 ** be used if any column of the index used for the scan is being
148605 /* Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF
149044 int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
149159 /* End the virtual table scan */
149178 /* End of the ephemeral table scan. Or, if using the onepass strategy,
149179 ** jump to here if the scan visited zero rows. */
151385 int addrSkip; /* Jump here for next iteration of skip-scan */
151389 int regBignull; /* big-null flag reg. True if a NULL-scan is needed */
151390 int addrBignull; /* Jump here for next part of big-null scan */
151932 #define WHERE_SKIPSCAN 0x00008000 /* Uses the skip-scan algorithm */
151937 #define WHERE_IN_SEEKSCAN 0x00100000 /* Seek-scan optimization for IN */
151942 #define WHERE_VIEWSCAN 0x02000000 /* A full-scan of a VIEW or subquery */
152042 ** is added to the output to describe the table scan strategy in pLevel.
152206 ** sqlite3_stmt_scanstatus() entry corresponding to the scan used to
152208 ** clause that the scan reads data from.
152645 ** index scan.
152729 VdbeComment((v, "begin skip-scan on %s", pIdx->zName));
152805 ** scan loop run twice, once for strings and a second time for BLOBs.
152948 WhereTerm *pEndRange /* Hint this end-of-scan boundary term if not NULL */
153015 ** scan (that has no == terms) so omit them. */
153024 /* For an index scan, make sure referenced columns are actually in
153060 ** However, if the scan currently being coded is a branch of an OR-loop and
153076 Index *pIdx, /* Index scan is using */
153253 int bRev; /* True if we need to scan in reverse order */
153596 /* Case 4: A scan using an index.
153730 /* If we are doing a reverse order scan on an ascending index, or
153731 ** a forward order scan on a descending index, interchange the
153801 /* The skip-scan logic inside the call to codeAllEqualityConstraints()
153807 VdbeComment((v, "NULL-scan pass ctr"));
153872 /* For a seek-scan that has a range on the lowest term of the index,
153919 /* Except, skip the end-of-range check while doing the NULL-scan */
153921 VdbeComment((v, "If NULL-scan 2nd pass"));
153933 /* During a NULL-scan, check to see if we have reached the end of
153939 VdbeComment((v, "If NULL-scan 1st pass"));
154187 WhereInfo *pSubWInfo; /* Info for single OR-term scan */
154287 ** If the call to sqlite3WhereBegin() above resulted in a scan that
154345 ** scan of the entire table.
156989 int iCur, /* Cursor to scan for */
156990 int iColumn, /* Column to scan for */
156991 u32 opMask, /* Operator(s) to scan for */
157060 WhereScan scan;
157062 p = whereScanInit(&scan, pWC, iCur, iColumn, op, pIdx);
157072 p = whereScanNext(&scan);
158166 ** bound on a range scan. Without considering pTerm, it is estimated
158167 ** that the scan will visit nNew rows. This function returns the number
158206 ** range-scan on a skip-scan index. For example:
158214 ** on the stat4 data for the index. this scan will be peformed multiple
158288 ** method (assume that the scan visits 1/64 of the rows) for estimating
158295 WHERETRACE(0x10, ("range skip-scan regions: %u..%u adjust=%d est=%d\n",
158328 ** equality constraints optimized by the proposed index scan. For example,
158341 ** number of rows that the index scan is expected to visit without
158473 WHERETRACE(0x10, ("STAT4 range scan: %u..%u est=%d\n",
158506 WHERETRACE(0x10,("Range scan lowers nOut from %d to %d\n",
158571 WHERETRACE(0x10,("equality scan regions %s(%d): %d\n",
158862 ** was added because if X uses skip-scan less than Y it still might
158971 ** than an automatic index. Unless it is a skip-scan. */
159346 WhereScan scan; /* Iterator for WHERE terms */
159388 pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, saved_nEq,
159393 for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
159470 ** from the index lookup and instead do a scan of the M elements,
159494 " nInMul=%d) prefers skip-scan\n",
159500 " nInMul=%d) prefers normal scan\n",
159521 if( scan.iEquiv>1 ) pNew->wsFlags |= WHERE_TRANSCONS;
159560 ** be visited by the index scan before considering term pTerm, or the
159685 /* Consider using a skip-scan if there are no WHERE clause constraints
159702 && pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */
159712 /* TUNING: Because uncertainties in the estimates for skip-scan queries,
159713 ** add a 1.375 fudge factor to make skip-scan slightly less likely. */
159896 ** For a full scan, assuming the table (or index) contains nRow rows:
159898 ** cost = nRow * 3.0 // full-table scan
159899 ** cost = nRow * K // scan of covering index
159900 ** cost = nRow * (K+3.0) // scan of non-covering index
159905 ** For an index scan, where nVisit is the number of index rows visited
159906 ** by the scan, and nSeek is the number of seek operations required on
159919 ** log(nRow) factor is omitted from a non-covering index scan in order to
159922 ** of a full table scan.
160071 /* Full table scan */
160073 /* TUNING: Cost of full table scan is 3.0*N. The 3.0 factor is an
160078 ** At 2.75, a full table scan is preferred over using an index on
160111 /* Full scan via index */
160131 /* If this is a non-covering index scan, add in the cost of
160381 ** that the scan will visit at most one row. Clear it otherwise. */
160780 ** of all sub-scans required by the OR-scan. However, due to rounding
160781 ** errors, it may be that the cost of the OR-scan is equal to its
160782 ** most expensive sub-scan. Add the smallest possible penalty
160789 ** the planner may elect to "OR" together a full-table scan and an
161474 /* TUNING: A full-scan of a VIEW or subquery in the outer loop
161738 WhereScan scan;
161756 pTerm = whereScanInit(&scan, pWC, iCur, -1, WO_EQ|WO_IS, 0);
161757 while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan);
161776 pTerm = whereScanInit(&scan, pWC, iCur, j, opMask, pIdx);
161777 while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan);
161806 if( scan.iEquiv>1 ) pLoop->wsFlags |= WHERE_TRANSCONS;
161874 ** must contain a constraint that limits the scan of the table to
162125 ** If the WHERE clause is empty, the foreach loops must each scan their
162128 ** refer to those indices, a complete table scan can be avoided and the
162501 ** and either (a) the scan visits at most one row or (b) each
162507 ** * either the scan does not use the OR optimization or the caller
162931 VdbeComment((v, "next skip-scan on %s", pLoop->u.btree.pIndex->zName));
163002 /* If this scan uses an index, make VDBE code substitutions to read data
163180 ** the same window declaration (the OVER bit), then a single scan may
163209 ** sqlite3WindowCodeStep() to process rows and finish the scan by calling
164478 ** or not. Identical window objects can be processed in a single scan.
164929 ** p->pMWin list by doing a full scan of the current window frame. Store the
179648 #define FTS3_FULLSCAN_SEARCH 0 /* Linear scan of %_content table */
181250 ** 3. Linear scan of %_content table.
181266 /* By default use a full table scan. This is an expensive option,
182611 int iLevel, /* Level of segments to scan */
182615 int isScan, /* True to scan from zTerm to EOF */
182622 /* If iLevel is less than 0 and this is not a scan, include a seg-reader
182623 ** for the pending-terms. If this is a scan, then this call must be being
182685 int iLevel, /* Level of segments to scan */
182689 int isScan, /* True to scan from zTerm to EOF */
182709 ** passed as the 4th argument also scan the doclist for term zTerm/nTerm.
182716 const char *zTerm, /* Term to scan doclist of */
182726 ** Open an Fts3MultiSegReader to scan the doclist for term zTerm/nTerm. Or,
182727 ** if isPrefix is true, to scan the doclist for all terms for which
182879 ** the next row that matches. For a full-table scan, this will be
182928 ** If idxNum==FTS3_FULLSCAN_SEARCH then do a full table scan against
183018 /* Compile a SELECT statement for this cursor. For a full-table-scan, the
183128 /* A user column. Or, if this is a full-table scan, possibly the
183793 ** An Fts3SegReader object is a cursor that can seek or scan a range of
183795 ** Fts3SegReader objects internally to provide an interface to seek or scan
185270 ** memory and scan it to determine the position list for each deferred
191600 Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
193519 ** incremental merge operation. Specifically, it opens a cursor to scan
194854 /* Based on the scan in the block above, it is known that there
200370 u32 iBegin; /* The first node of the scan */
200838 jsonEachFilter, /* xFilter - configure scan constraints */
200840 jsonEachEof, /* xEof - check for end of scan */
200866 jsonEachFilter, /* xFilter - configure scan constraints */
200868 jsonEachEof, /* xEof - check for end of scan */
202083 ** record (i.e if the scan has finished), or zero otherwise.
202824 /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array
202899 ** table scan strategies to choose from (in order from most to
202905 ** 2 See below R-tree query or full-table scan.
202936 i64 nRow; /* Estimated rows returned by this scan */
204435 rtreeFilter, /* xFilter - configure scan constraints */
206689 ** 4 full table scan
206729 /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array
206812 ** table scan strategies to choose from (in order from most to
206820 ** 4 "fullscan" full-table scan.
207097 geopolyFilter, /* xFilter - configure scan constraints */
208297 ** pattern that resembles a single linear scan through the index b-tree,
215063 statFilter, /* xFilter - configure scan constraints */
215065 statEof, /* xEof - check for end of scan */
215131 int mxPgno; /* Last page to visit on this scan */
215192 ** 0 schema=main, full table scan
215194 ** 2 schema=?1, full table scan
215297 ** 0 schema=main, full table scan
215299 ** 2 schema=?1, full table scan
215491 dbpageFilter, /* xFilter - configure scan constraints */
215493 dbpageEof, /* xEof - check for end of scan */
216369 u8 *a = pChange->aRecord; /* Cursor used to scan change record */
229477 Fts5HashEntry *pScan; /* Current ordered scan item */
235208 int iIdx, /* Index to scan for data */
235967 ** is because the hash table only supports a single scan query at
235969 ** is already performing such a scan.
236268 ** while doing a linear scan of each individual index in turn.
238031 ** 3. A full-table scan.
238198 /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup
244554 stmtFilter, /* xFilter - configure scan constraints */
244556 stmtEof, /* xEof - check for end of scan */