1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add a new opcode to the VDBE that gives the b-tree a hint about the set

of columns in a table or index that are actually used by the query.

FossilOrigin-Name: f167bba446b78dd7538d0b2bae3e6678f3b1ba28
This commit is contained in:
drh
2015-06-05 15:59:57 +00:00
parent d62fbb50e6
commit 97bae794c2
8 changed files with 77 additions and 29 deletions

View File

@@ -3511,6 +3511,26 @@ case OP_Close: {
break;
}
#ifdef SQLITE_ENABLE_COLUMN_USED_MASK
/* Opcode: ColumnsUsed P1 * * P4 *
**
** This opcode (which only exists if SQLite was compiled with
** SQLITE_ENABLE_COLUMN_USED_MASK) identifies which columns of the
** table or index for cursor P1 are used. P4 is a 64-bit integer
** (P4_INT64) in which the first 63 bits are one for each of the
** first 63 columns of the table or index that are actually used
** by the cursor. The high-order bit is set if any column after
** the 64th is used.
*/
case OP_ColumnsUsed: {
VdbeCursor *pC;
pC = p->apCsr[pOp->p1];
assert( pC->pCursor );
pC->maskUsed = *(u64*)pOp->p4.pI64;
break;
}
#endif
/* Opcode: SeekGE P1 P2 P3 P4 *
** Synopsis: key=r[P3@P4]
**