1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +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:
danielk1977
2009-04-21 09:02:45 +00:00
parent 8a93919082
commit 1d46146b58
20 changed files with 23972 additions and 24990 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.854 2009/04/08 13:51:51 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.855 2009/04/21 09:02:47 danielk1977 Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -557,6 +557,7 @@ struct BusyHandler {
typedef struct AggInfo AggInfo;
typedef struct AuthContext AuthContext;
typedef struct Bitvec Bitvec;
typedef struct RowHash RowHash;
typedef struct RowSet RowSet;
typedef struct CollSeq CollSeq;
typedef struct Column Column;
@@ -1751,6 +1752,7 @@ struct WhereLevel {
#define WHERE_FILL_ROWSET 0x0008 /* Save results in a RowSet object */
#define WHERE_OMIT_OPEN 0x0010 /* Table cursor are already open */
#define WHERE_OMIT_CLOSE 0x0020 /* Omit close of table & index cursors */
#define WHERE_FILL_ROWHASH 0x0040 /* Save results in a RowHash object */
/*
** The WHERE clause processing routine has two halves. The
@@ -1763,7 +1765,8 @@ struct WhereInfo {
Parse *pParse; /* Parsing and code generating context */
u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
u8 okOnePass; /* Ok to use one-pass algorithm for UPDATE or DELETE */
int regRowSet; /* Store rowids in this rowset if >=0 */
int regRowSet; /* Store rowids in this rowset/rowhash */
int iRowidHandler; /* Address of OP_RowSet or OP_RowHash */
SrcList *pTabList; /* List of tables in the join */
int iTop; /* The very beginning of the WHERE loop */
int iContinue; /* Jump here to continue with next record */
@@ -2399,6 +2402,10 @@ void sqlite3RowSetClear(RowSet*);
void sqlite3RowSetInsert(RowSet*, i64);
int sqlite3RowSetNext(RowSet*, i64*);
int sqlite3RowhashInsert(RowHash **pp, i64 iVal);
int sqlite3RowhashTest(RowHash *p, int iSet, i64 iVal, int *pExists);
void sqlite3RowhashDestroy(RowHash *p);
void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int,int);
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)