SQLITE_SCANSTAT_NLOOP(3) | Library Functions Manual | SQLITE_SCANSTAT_NLOOP(3)

# NAME

`SQLITE_SCANSTAT_NLOOP`, `SQLITE_SCANSTAT_NVISIT`, `SQLITE_SCANSTAT_EST`, `SQLITE_SCANSTAT_NAME`, `SQLITE_SCANSTAT_EXPLAIN`, `SQLITE_SCANSTAT_SELECTID` —
Prepared Statement Scan Status Opcodes

# SYNOPSIS

`#define SQLITE_SCANSTAT_NLOOP`
`#define SQLITE_SCANSTAT_NVISIT`
`#define SQLITE_SCANSTAT_EST`
`#define SQLITE_SCANSTAT_NAME`
`#define SQLITE_SCANSTAT_EXPLAIN`
`#define SQLITE_SCANSTAT_SELECTID`

# DESCRIPTION

The following constants can be used for the T parameter to the sqlite3_stmt_scanstatus(S,X,T,V) interface. Each constant designates a different metric for sqlite3_stmt_scanstatus() to return.

When the value returned to V is a string, space to hold that string is managed by the prepared statement S and will be automatically freed when S is finalized.

SQLITE_SCANSTAT_NLOOP
  The sqlite3_int64 variable pointed to by the T parameter will be set to the total number of times that the X-th loop has run.
SQLITE_SCANSTAT_NVISIT
  The sqlite3_int64 variable pointed to by the T parameter will be set to the total number of rows examined by all iterations of the X-th loop.
SQLITE_SCANSTAT_EST
  The "double" variable pointed to by the T parameter will be set to the query planner's estimate for the average number of rows output from each iteration of the X-th loop. If the query planner's estimates was accurate, then this value will approximate the quotient NVISIT/NLOOP and the product of this value for all prior loops with the same SELECTID will be the NLOOP value for the current loop.
SQLITE_SCANSTAT_NAME
  The "const char *" variable pointed to by the T parameter will be set to a zero-terminated UTF-8 string containing the name of the index or table used for the X-th loop.
SQLITE_SCANSTAT_EXPLAIN
  The "const char *" variable pointed to by the T parameter will be set to a zero-terminated UTF-8 string containing the EXPLAIN QUERY PLAN description for the X-th loop.
SQLITE_SCANSTAT_SELECT
  The "int" variable pointed to by the T parameter will be set to the "select-id" for the X-th loop. The select-id identifies which query or subquery the loop is part of. The main query has a select-id of zero. The select-id is the same value as is output in the first column of an EXPLAIN QUERY PLAN query.

# SEE ALSO

sqlite_int64(3)

December 19, 2018 | NetBSD 9.5