diff options
author | dan <Dan Kennedy> | 2022-12-02 20:32:22 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2022-12-02 20:32:22 +0000 |
commit | 231ff4b027b077ce9ac0c829cd9cee4108ca9b7a (patch) | |
tree | 5cf6210ffda1cc351169cef8dc576ac2edc83fc9 /src/expr.c | |
parent | bb4e4a4840530da37c6fdaabc9769a1996f25809 (diff) | |
download | sqlite-231ff4b027b077ce9ac0c829cd9cee4108ca9b7a.tar.gz sqlite-231ff4b027b077ce9ac0c829cd9cee4108ca9b7a.zip |
Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports.
FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index d30ae9766..07e44a187 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3257,6 +3257,9 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ SelectDest dest; /* How to deal with SELECT result */ int nReg; /* Registers to allocate */ Expr *pLimit; /* New limit expression */ +#ifdef SQLITE_ENABLE_STMT_SCANSTATUS + int addrExplain; +#endif Vdbe *v = pParse->pVdbe; assert( v!=0 ); @@ -3309,7 +3312,7 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ ** In both cases, the query is augmented with "LIMIT 1". Any ** preexisting limit is discarded in place of the new LIMIT 1. */ - ExplainQueryPlan((pParse, 1, "%sSCALAR SUBQUERY %d", + ExplainQueryPlan2(addrExplain, (pParse, 1, "%sSCALAR SUBQUERY %d", addrOnce?"":"CORRELATED ", pSel->selId)); nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1; sqlite3SelectDestInit(&dest, 0, pParse->nMem+1); @@ -3353,6 +3356,8 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ if( addrOnce ){ sqlite3VdbeJumpHere(v, addrOnce); } + sqlite3VdbeScanStatusEnd(v, addrExplain); + /* Subroutine return */ assert( ExprUseYSub(pExpr) ); |