diff options
author | drh <> | 2024-07-05 13:55:59 +0000 |
---|---|---|
committer | drh <> | 2024-07-05 13:55:59 +0000 |
commit | 42123a294d38c5e25d2960f9f06e70b5850f39a0 (patch) | |
tree | cdfe5bcf9995cd913bf7460a59bbfca488ddb4b5 /src/expr.c | |
parent | 635c6b8086834600f93c1002c7a0ffe3c34e9c51 (diff) | |
download | sqlite-42123a294d38c5e25d2960f9f06e70b5850f39a0.tar.gz sqlite-42123a294d38c5e25d2960f9f06e70b5850f39a0.zip |
Use a mini Bloom filter to help reduce the number of pointless searches for
prior SubrtnSig objects when generating code for IN operators with subqueries
as their right operand.
FossilOrigin-Name: d8cedbe055b40a0ea4e5d47845b535162e9fcb0d0f88c03211797ab64d2d56fb
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c index d012c3d5e..e7df61c86 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3436,7 +3436,7 @@ static int findCompatibleInRhsSubrtn( Vdbe *v; if( pNewSig==0 ) return 0; - if( pParse->bHasSubrtn==0 ) return 0; + if( (pParse->mSubrtnSig & (1<<(pNewSig->selId&7)))==0 ) return 0; assert( pExpr->op==TK_IN ); assert( !ExprUseYSub(pExpr) ); assert( ExprUseXSelect(pExpr) ); @@ -3564,7 +3564,7 @@ void sqlite3CodeRhsOfIN( pSig->regReturn = pExpr->y.sub.regReturn; pSig->iTable = iTab; sqlite3VdbeChangeP4(v, -1, (const char*)pSig, P4_SUBRTNSIG); - pParse->bHasSubrtn = 1; + pParse->mSubrtnSig = 1 << (pSig->selId&7); } addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); } |