1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Extra VDBE comments in the NULLS LAST logic provide landmarks to help

understand the EXPLAIN output.

FossilOrigin-Name: 649b08ead50f10a9ec0357a5e1ed020195d9f93be61ef703ea036a8e53f07a34
This commit is contained in:
drh
2019-08-23 13:08:49 +00:00
parent 505ae9def8
commit 74e1b861ad
5 changed files with 16 additions and 11 deletions

View File

@@ -1550,7 +1550,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
u8 bSeekPastNull = 0; /* True to seek past initial nulls */
u8 bStopAtNull = 0; /* Add condition to terminate at NULLs */
int omitTable; /* True if we use the index only */
int regBignull = 0;
int regBignull = 0; /* big-null flag register */
pIdx = pLoop->u.btree.pIndex;
iIdxCur = pLevel->iIdxCur;
@@ -1691,6 +1691,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
}
if( regBignull ){
sqlite3VdbeAddOp2(v, OP_Integer, 0, regBignull);
VdbeComment((v, "NULL-scan flag"));
}
op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev];
@@ -1776,6 +1777,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
if( nConstraint ){
if( regBignull ){
sqlite3VdbeAddOp2(v, OP_If, regBignull, sqlite3VdbeCurrentAddr(v)+3);
VdbeComment((v, "If in NULL-scan"));
VdbeCoverage(v);
}
op = aEndOp[bRev*2 + endEq];
@@ -1787,6 +1789,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
}
if( regBignull ){
sqlite3VdbeAddOp2(v, OP_IfNot, regBignull, sqlite3VdbeCurrentAddr(v)+2);
VdbeComment((v, "If not in NULL-scan"));
VdbeCoverage(v);
if( bStopAtNull ){
op = aEndOp[bRev*2 + 0];