SQLite

Check-in [75437bee49]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 75437bee4905949c66dc7694ea234d4d5aefd981
User & Date: drh 2014-06-06 20:20:09.587
Context
2014-06-06
20:49
Add a test case to ensure that estLog() works for negative numbers. (check-in: 813469d985 user: drh tags: trunk)
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: 75437bee49 user: drh tags: trunk)
17:09
Fix an obsolete comment on the whereRangeScanEst() routine. No changes to code. (check-in: b16bf8518b user: drh tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/where.c.
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
}


/*
** Estimate the logarithm of the input value to base 2.
*/
static LogEst estLog(LogEst N){
  LogEst x = sqlite3LogEst(N);
  return x>33 ? x - 33 : 0;
}

/*
** Two routines for printing the content of an sqlite3_index_info
** structure.  Used for testing and debugging only.  If neither
** SQLITE_TEST or SQLITE_DEBUG are defined, then these routines







|







1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
}


/*
** Estimate the logarithm of the input value to base 2.
*/
static LogEst estLog(LogEst N){
  LogEst x = N<0 ? 1 : sqlite3LogEst(N);
  return x>33 ? x - 33 : 0;
}

/*
** Two routines for printing the content of an sqlite3_index_info
** structure.  Used for testing and debugging only.  If neither
** SQLITE_TEST or SQLITE_DEBUG are defined, then these routines