Skip to content

query_advisor

Workload-based index and extended-statistics recommendations.

edb_query_advisor · Workload-based index and extended-statistics recommendations.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101953query_advisoredb_query_advisor1.2.2ADMINProprietaryUnknown

Usage

Sources:

query_advisor samples workload predicates and planning errors to recommend useful indexes and multicolumn extended statistics without creating every candidate object first.

Enablement

The product package is named EDB Query Advisor, but the canonical extension and preload identity is query_advisor. Install version 1.2.2, preload it, restart, and create it:

shared_preload_libraries = 'query_advisor'
CREATE EXTENSION query_advisor;

Use query_advisor.sample_rate and query_advisor.exclude_schema_list to scope collection. Capacity parameters such as query_advisor.max_qual_entries require a restart.

Generate Recommendations

SELECT *
FROM query_advisor_index_recommendations();

SELECT *
FROM query_advisor_statistics_recommendations();

SELECT *
FROM query_advisor_qualstats_pretty;

Index recommendations are costed against captured workload queries with hypothetical indexes. Statistics recommendations focus on two-column combinations and include weights and benefited query IDs.

Review Boundary

Collected data is held in memory and is lost at server restart. Recommendations are candidates, not automatic DDL: validate write amplification, storage, maintenance, redundant indexes, and production plan changes before executing the generated CREATE INDEX or CREATE STATISTICS command.

Table reader