/ Check-in [b16bf851]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an obsolete comment on the whereRangeScanEst() routine. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b16bf8518b7c50f6a939aa54900fea91b1098470
User & Date: drh 2014-06-06 17:09:52
Context
2014-06-06
20:20
Make sure the estLog() routine in the query planner handles negative values correctly (always returning 1). Prior to this change, estLog(-1) would return a large number which could throw off the cost computations in the query planner in obscure circumstances. check-in: 75437bee user: drh tags: trunk
17:09
Fix an obsolete comment on the whereRangeScanEst() routine. No changes to code. check-in: b16bf851 user: drh tags: trunk
2014-06-05
11:15
Fix a problem that was causing the FTS4 integrity-check command to fail if the table had one or more "notindexed" columns. check-in: 7123bb26 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  2031   2031   ** When this function is called, *pnOut is set to the sqlite3LogEst() of the
  2032   2032   ** number of rows that the index scan is expected to visit without 
  2033   2033   ** considering the range constraints. If nEq is 0, this is the number of 
  2034   2034   ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced)
  2035   2035   ** to account for the range contraints pLower and pUpper.
  2036   2036   ** 
  2037   2037   ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be
  2038         -** used, each range inequality reduces the search space by a factor of 4. 
  2039         -** Hence a pair of constraints (x>? AND x<?) reduces the expected number of
  2040         -** rows visited by a factor of 16.
         2038  +** used, a single range inequality reduces the search space by a factor of 4. 
         2039  +** and a pair of constraints (x>? AND x<?) reduces the expected number of
         2040  +** rows visited by a factor of 64.
  2041   2041   */
  2042   2042   static int whereRangeScanEst(
  2043   2043     Parse *pParse,       /* Parsing & code generating context */
  2044   2044     WhereLoopBuilder *pBuilder,
  2045   2045     WhereTerm *pLower,   /* Lower bound on the range. ex: "x>123" Might be NULL */
  2046   2046     WhereTerm *pUpper,   /* Upper bound on the range. ex: "x<455" Might be NULL */
  2047   2047     WhereLoop *pLoop     /* Modify the .nOut and maybe .rRun fields */