diff options
author | drh <drh@noemail.net> | 2010-08-30 22:15:45 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-08-30 22:15:45 +0000 |
commit | d4187c716c534617d261fa198c5467bd57feb975 (patch) | |
tree | 346c695ee4369dee119100dd50e1d7361223ae98 /src/expr.c | |
parent | c223b8f1a8e2946a6e4d04ea6256df808c4881bd (diff) | |
download | sqlite-d4187c716c534617d261fa198c5467bd57feb975.tar.gz sqlite-d4187c716c534617d261fa198c5467bd57feb975.zip |
Provide hints to the btree layer during the creation of transient tables
when it is possible for those tables to use a hash rather than a binary tree.
No use is current made of those hints, though assert() statement verify
their accuracy.
FossilOrigin-Name: 4fead8e714c7e50a9d246467e62bc846ef6180a0
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c index 33864b2da..a23a7b197 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1535,8 +1535,8 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ #endif /* -** Generate code for scalar subqueries used as an expression -** and IN operators. Examples: +** Generate code for scalar subqueries used as a subquery expression, EXISTS, +** or IN operators. Examples: ** ** (SELECT a FROM b) -- subquery ** EXISTS (SELECT a FROM b) -- EXISTS subquery @@ -1599,10 +1599,10 @@ int sqlite3CodeSubselect( switch( pExpr->op ){ case TK_IN: { - char affinity; - KeyInfo keyInfo; - int addr; /* Address of OP_OpenEphemeral instruction */ - Expr *pLeft = pExpr->pLeft; + char affinity; /* Affinity of the LHS of the IN */ + KeyInfo keyInfo; /* Keyinfo for the generated table */ + int addr; /* Address of OP_OpenEphemeral instruction */ + Expr *pLeft = pExpr->pLeft; /* the LHS of the IN operator */ if( rMayHaveNull ){ sqlite3VdbeAddOp2(v, OP_Null, 0, rMayHaveNull); @@ -1625,6 +1625,7 @@ int sqlite3CodeSubselect( */ pExpr->iTable = pParse->nTab++; addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, !isRowid); + if( rMayHaveNull==0 ) sqlite3VdbeChangeP5(v, BTREE_UNORDERED); memset(&keyInfo, 0, sizeof(keyInfo)); keyInfo.nField = 1; |