1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Refactor the ORDER BY optimizer in the NGQP so that it is easier to maintain

and so that it can support optimizing out GROUP BY and DISTINCT clauses.

FossilOrigin-Name: e605c468e3a1163167831c4a6220825c0b5d083b
This commit is contained in:
drh
2013-06-04 12:42:29 +00:00
parent 7c171098b7
commit 7699d1c4e5
6 changed files with 210 additions and 137 deletions

View File

@@ -1544,6 +1544,7 @@ struct Index {
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
unsigned autoIndex:2; /* 1==UNIQUE, 2==PRIMARY KEY, 0==CREATE INDEX */
unsigned bUnordered:1; /* Use this index for == or IN queries only */
unsigned uniqNotNull:1; /* True if UNIQUE and NOT NULL for all columns */
#ifdef SQLITE_ENABLE_STAT3
int nSample; /* Number of elements in aSample[] */
tRowcnt avgEq; /* Average nEq value for key values not in aSample */
@@ -1889,6 +1890,11 @@ typedef u64 Bitmask;
*/
#define BMS ((int)(sizeof(Bitmask)*8))
/*
** A bit in a Bitmask
*/
#define MASKBIT(n) (((Bitmask)1)<<(n))
/*
** The following structure describes the FROM clause of a SELECT statement.
** Each table or subquery in the FROM clause is a separate element of