Source: https://guthlabs.ai/docs/instruments/database-index-selectivity-cardinality-estimator/implementation/

instrument implementation / implementation-contract

# Database Index Selectivity / Cardinality Estimator implementation

A source-bound implementation contract for Database Index Selectivity / Cardinality Estimator; deployment and executable qualification remain separate.

Status: **VERIFIED_CLEAN**Lifecycle: **implementation-contract**

## Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

**Record owner**: Guth Instruments

**Lifecycle**: verified-clean

**Evidence ID**: t5-079

**Effect**: Computation or source lookup only

## Input and validation requirements

The formulas have undefined results when total_rows or distinct_values is zero, and the specification does not state input validation for zero or for distinct_values greater than total_rows. The specification also does not define a threshold or rule for the requested index-usefulness verdict, so that output cannot be reliably produced.

## Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

## Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

````
{
  "inputs": {
    "total_rows": 1000000,
    "distinct_values": 1000000
  },
  "expected_outputs": {
    "selectivity_ratio": 1,
    "estimated_rows_per_lookup": 1,
    "index_usefulness_verdict": "UNDEFINED_BY_SPEC"
  },
  "working": "selectivity_ratio = distinct_values / total_rows = 1000000 / 1000000 = 1. estimated_rows_per_lookup = total_rows / distinct_values = 1000000 / 1000000 = 1 row per lookup. The index-usefulness verdict has no specified formula or threshold."
}
````

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/database-index-selectivity-cardinality-estimator/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/database-index-selectivity-cardinality-estimator/mechanism/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/database-index-selectivity-cardinality-estimator/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche5/tranche5-results.json`
