pg_qualstats
An extension collecting statistics about quals
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_qualstats | 2.1.4 | STAT | BSD-3-Clause | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6240 | pg_qualstats | No | Yes | Yes | Yes | No | No | - |
| Related | online_advisor hypopg index_advisor pg_hint_plan pg_stat_plans plan_filter pg_relusage pg_track_optimizer pg_regresql pg_strom |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.1.4 | 1817161514 | pg_qualstats | - |
| RPM | PGDG | 2.1.4 | 1817161514 | pg_qualstats_$v | - |
| DEB | PGDG | 2.1.4 | 1817161514 | postgresql-$v-pg-qualstats | - |
Install
You can install pg_qualstats directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Preload:
Create Extension:
Usage
pg_qualstats keeps statistics on predicates found in WHERE clauses and JOIN conditions. It tracks which columns are most frequently queried and which are queried together, enabling index recommendations.
Viewing Predicate Statistics
Index Advisor
Generate index suggestions based on collected predicate statistics:
Utility Functions
Configuration
| Parameter | Default | Description |
|---|---|---|
pg_qualstats.enabled | true | Enable/disable collection |
pg_qualstats.track_constants | true | Track individual constant values |
pg_qualstats.max | 1000 | Maximum tracked predicates and query texts |
pg_qualstats.resolve_oids | false | Resolve OIDs at query time (uses more space) |
pg_qualstats.track_pg_catalog | false | Track predicates on pg_catalog objects |
pg_qualstats.sample_rate | -1 | Fraction of queries to sample (-1 = auto: 1/max_connections) |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)