What does HRESULT 0x87AF011C (SQLITE_E_WARNING_AUTOINDEX) mean?

 
Previous Next
SQLITE_E_NOTICE_RECOVER_WAL SQLITE_E_ABORT_ROLLBACK

SQLITE_E_WARNING_AUTOINDEX

SQLITE_E_WARNING_AUTOINDEX (0x87AF011C) represents SQLite query planner created a transient automatic index. This extended warning is emitted when SQLite builds an automatic index to improve a query that lacks a suitable persistent index. The query can still succeed, but repeated warnings may expose avoidable planning and build cost. For SQLITE_E_WARNING_AUTOINDEX, apply the native SQLite state-machine rules even though Windows stores the result in an HRESULT facility.

Capture the plan

  • Record the exact SQL and bound-value shape.
  • Run EXPLAIN QUERY PLAN against a representative database.
  • Keep table cardinalities and existing index definitions.

Interpretation

WorkloadDecision
Occasional small queryThe automatic index cost may be acceptable.
Hot or large joinA persistent index might reduce repeated construction work.
Changing workloadOne index chosen from a single sample may harm writes or other plans.

Measure before adding an index

  1. Benchmark with production-like data
  2. Create the candidate index in a disposable copy
  3. Compare read latency, write cost, file size, and planner choice

Verification

The chosen schema or query plan removes the repeated warning under the target workload without regressing writes. Disabling automatic indexes globally is not evidence of improvement.

Use planner evidence, not warning suppression

Refresh representative statistics when appropriate and compare EXPLAIN QUERY PLAN before and after a candidate index. A persistent index should match the real join and filter pattern; adding every warned column can increase write amplification and still leave the planner choosing a transient index. Retest after realistic data growth rather than only on a tiny development database.

Questions that narrow SQLITE_E_WARNING_AUTOINDEX

QuestionDiagnostic direction
Same input rejected elsewhereAgreement at the same offset supports a representation or contract cause
Known-good sample fails locallyAttention shifts to local libraries, state, packaging, or configuration
Clean process behaves differentlyLook for mutation, leaked state, concurrency, or cached negotiation
Boundary control no longer failsValidation may have been disabled rather than corrected

Preserve causal order for SQLITE_E_WARNING_AUTOINDEX

Timestamp acquisition, parsing or preparation, the call returning SQLITE_E_WARNING_AUTOINDEX, automatic retry, and cleanup so a later network, storage, or disposal result cannot replace the original cause.

SQLite object lifetimes for SQLITE_E_WARNING_AUTOINDEX

ObjectRecord
Database connectionOpen flags, threading mode, transaction state, and latest connection error
Prepared statementSQL identity, bindings, prepare API, and step call
Current rowColumn values governed by the documented SQLITE_ROW lifetime
Log callbackExtended code and message retained even when the active API succeeds

Native SQLite identity behind SQLITE_E_WARNING_AUTOINDEX

Keep the primary and extended SQLite result before mapping it to SQLITE_E_WARNING_AUTOINDEX, because masking the low byte or treating every HRESULT alike can erase the distinction among ROW, DONE, NOTICE, WARNING, and an extended warning.

Cleanup paths for SQLITE_E_WARNING_AUTOINDEX

  • Finalize every statement that will not be reused
  • Reset reusable statements only at a documented terminal state
  • Avoid recursive SQLite use from the configured log callback
  • Verify rollback, commit, and close independently from this result

Decision boundary for SQLITE_E_WARNING_AUTOINDEX

EvidenceUse
Direct API returnDetermines control flow for prepare, step, reset, finalize, or transaction work
Extended result codePreserves the specific SQLite condition before HRESULT translation
Log callback eventAdds diagnostics but does not automatically replace the direct API result
Transaction outcomeSeparately determines whether completed statement work becomes durable

Technical references for SQLITE_E_WARNING_AUTOINDEX


Looking for a different code? Search another status or error code.