diff options
author | drh <> | 2021-03-23 01:06:02 +0000 |
---|---|---|
committer | drh <> | 2021-03-23 01:06:02 +0000 |
commit | a7fc252b0a19e9f147b36f6b5cd8825522c2c239 (patch) | |
tree | de92cf9b96369bf12594923f676bc000d352cb1c /src/wherecode.c | |
parent | f93ff6b9f465dcc24b2655f8eabf28af166a7c03 (diff) | |
parent | e3e8f5ce9c852032ffca77c84d7e056b3ec01b4e (diff) | |
download | sqlite-a7fc252b0a19e9f147b36f6b5cd8825522c2c239.tar.gz sqlite-a7fc252b0a19e9f147b36f6b5cd8825522c2c239.zip |
Enhance the EXPLAIN QUERY PLAN output to use symbolic names to describe
subqueries, where possible, instead of cryptic subquery index numbers.
And in other ways, make the EQP output cleaner and easier to read. Little
code is changed, but many of the test results had to be tweaked to align
with the new output format.
FossilOrigin-Name: f8e28308fdb45fbdef30003320d653410d69bb8ec92eef35c4245a99e2d0603b
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index a7a76fb70..771a50fc7 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -148,16 +148,8 @@ int sqlite3WhereExplainOneScan( || (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX)); sqlite3StrAccumInit(&str, db, zBuf, sizeof(zBuf), SQLITE_MAX_LENGTH); - sqlite3_str_appendall(&str, isSearch ? "SEARCH" : "SCAN"); - if( pItem->pSelect ){ - sqlite3_str_appendf(&str, " SUBQUERY %u", pItem->pSelect->selId); - }else{ - sqlite3_str_appendf(&str, " TABLE %s", pItem->zName); - } - - if( pItem->zAlias ){ - sqlite3_str_appendf(&str, " AS %s", pItem->zAlias); - } + str.printfFlags = SQLITE_PRINTF_INTERNAL; + sqlite3_str_appendf(&str, "%s %S", isSearch ? "SEARCH" : "SCAN", pItem); if( (flags & (WHERE_IPK|WHERE_VIRTUALTABLE))==0 ){ const char *zFmt = 0; Index *pIdx; |