mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Attempt to optimize virtual table queries with 'OR' expressions in the WHERE clause. (CVS 6527)
FossilOrigin-Name: f61e4cd93682fd98bea2a71d346f9eaa68454390
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** testing of the SQLite library.
|
||||
**
|
||||
** $Id: test8.c,v 1.76 2009/04/08 15:45:32 drh Exp $
|
||||
** $Id: test8.c,v 1.77 2009/04/21 09:02:47 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -893,16 +893,16 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
|
||||
pIdxInfo->idxNum = hashString(zQuery);
|
||||
pIdxInfo->idxStr = zQuery;
|
||||
pIdxInfo->needToFreeIdxStr = 1;
|
||||
if (useCost) {
|
||||
if( useCost ){
|
||||
pIdxInfo->estimatedCost = cost;
|
||||
} else if( useIdx ){
|
||||
}else if( useIdx ){
|
||||
/* Approximation of log2(nRow). */
|
||||
for( ii=0; ii<(sizeof(int)*8); ii++ ){
|
||||
if( nRow & (1<<ii) ){
|
||||
pIdxInfo->estimatedCost = (double)ii;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}else{
|
||||
pIdxInfo->estimatedCost = (double)nRow;
|
||||
}
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user