aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <>2025-07-06 01:19:09 +0000
committerdrh <>2025-07-06 01:19:09 +0000
commitc701d173668b07e743e7af8132842b7e6d8c1922 (patch)
tree087abb66c5ba91d9258b872e28395e342926f764 /src/wherecode.c
parent8bc112e3e453a9e574a800e7edab3afecb064449 (diff)
downloadsqlite-c701d173668b07e743e7af8132842b7e6d8c1922.tar.gz
sqlite-c701d173668b07e743e7af8132842b7e6d8c1922.zip
Improvements to the EXPLAIN QUERY PLAN output for EXISTS-to-JOIN.
FossilOrigin-Name: 6b1ecbaa2ee405be040901dceac45d027d35c313622748ba4dbbd404e297a7fa
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index 9c611001b..5111880c0 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -126,7 +126,6 @@ void sqlite3WhereAddExplainText(
#endif
{
VdbeOp *pOp = sqlite3VdbeGetOp(pParse->pVdbe, addr);
-
SrcItem *pItem = &pTabList->a[pLevel->iFrom];
sqlite3 *db = pParse->db; /* Database handle */
int isSearch; /* True for a SEARCH. False for SCAN. */
@@ -135,7 +134,6 @@ void sqlite3WhereAddExplainText(
#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
char *zMsg; /* Text to add to EQP output */
#endif
- const char *zFormat;
StrAccum str; /* EQP output string */
char zBuf[100]; /* Initial space for EQP output string */
@@ -150,14 +148,10 @@ void sqlite3WhereAddExplainText(
sqlite3StrAccumInit(&str, db, zBuf, sizeof(zBuf), SQLITE_MAX_LENGTH);
str.printfFlags = SQLITE_PRINTF_INTERNAL;
- if( pItem->fg.fromExists ){
- zFormat = "SINGLETON %S";
- }else if( isSearch ){
- zFormat = "SEARCH %S";
- }else{
- zFormat = "SCAN %S";
- }
- sqlite3_str_appendf(&str, zFormat, pItem);
+ sqlite3_str_appendf(&str, "%s %S%s",
+ isSearch ? "SEARCH" : "SCAN",
+ pItem,
+ pItem->fg.fromExists ? " EXISTS" : "");
if( (flags & (WHERE_IPK|WHERE_VIRTUALTABLE))==0 ){
const char *zFmt = 0;
Index *pIdx;