estimateSelectivity
estimateSelectivityEstimate how selective a proposed table predicate is without running the query, returning planner-estimated rows, the unfiltered baseline, and their ratio to guide filter evaluation and composite-index column ordering.
Instructions
Estimate how selective one proposed table predicate is without executing the query. Returns planner-estimated rows, the unfiltered baseline and their ratio; use when evaluating filters or composite-index column order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | No | ||
| predicate | Yes | Raw boolean SQL without WHERE or ';'. | |
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Additional context about support, limits, interpretation, or engine-specific behavior. | |
| table | No | Table on which the predicate selectivity was estimated. | |
| schema | No | ||
| predicate | No | Raw SQL predicate without the WHERE keyword used for selectivity estimation. | |
| selectivity | No | Estimated predicate selectivity, calculated as estimated rows divided by baseline rows. | |
| baselineRows | No | Planner row estimate for the table without the predicate. | |
| estimatedRows | No | Planner or catalog estimate of rows for this object or operation. |