SQLITE3_STMT_SCANSTATUS(3)

SQLITE3_STMT_SCANSTATUS(3) | Library Functions Manual | SQLITE3_STMT_SCANSTATUS(3)

# NAME

`sqlite3_stmt_scanstatus` —
Prepared Statement Scan Status

# SYNOPSIS

int
`sqlite3_stmt_scanstatus`(sqlite3_stmt *pStmt, int idx, int iScanStatusOp, void *pOut );

# DESCRIPTION

This interface returns information about the predicted and measured performance for pStmt. Advanced applications can use this interface to compare the predicted and the measured performance and issue warnings and/or rerun ANALYZE if discrepancies are found.

Since this interface is expected to be rarely used, it is only available if SQLite is compiled using the SQLITE_ENABLE_STMT_SCANSTATUS compile-time option.

The "iScanStatusOp" parameter determines which status information to return. The "iScanStatusOp" must be one of the scanstatus options or the behavior of this interface is undefined. The requested measurement is written into a variable pointed to by the "pOut" parameter. Parameter "idx" identifies the specific loop to retrieve statistics for. Loops are numbered starting from zero. If idx is out of range - less than zero or greater than or equal to the total number of loops used to implement the statement - a non-zero value is returned and the variable that pOut points to is unchanged.

Statistics might not be available for all loops in all statements. In cases where there exist loops with no available statistics, this function behaves as if the loop did not exist - it returns non-zero and leave the variable that pOut points to unchanged.

# SEE ALSO

SQLITE_SCANSTAT_NLOOP(3), sqlite3_stmt_scanstatus_reset(3)

December 19, 2018 | NetBSD 10.0