mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -3834,7 +3834,7 @@ struct Parse {
|
||||
u8 prepFlags; /* SQLITE_PREPARE_* flags */
|
||||
u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */
|
||||
u8 bHasWith; /* True if statement contains WITH */
|
||||
u8 bHasSubrtn; /* True if any P4_SUBRTNSIG has been set */
|
||||
u8 mSubrtnSig; /* mini Bloom filter on available SubrtnSig.selId */
|
||||
#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
|
||||
u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user