SQLITE3_STMT_SCANSTATUS(3)

NAME
sqlite3_stmt_scanstatus - Prepared Statement Scan Status

SYNOPSIS
#include <sqlite.h>
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.

IMPLEMENTATION NOTES
These declarations were extracted from the interface documentation at line 9208.

    SQLITE_API int sqlite3_stmt_scanstatus(
      sqlite3_stmt *pStmt,      /* Prepared statement for which info desired */
      int idx,                  /* Index of loop to report on */
      int iScanStatusOp,        /* Information desired.  SQLITE_SCANSTAT_* */
      void *pOut                /* Result written here */
    );

SEE ALSO
SQLITE_SCANSTAT_NLOOP(3), sqlite3_stmt_scanstatus_reset(3)