The pg_hint_plan
module allows tweaking PostgreSQL execution plans with hints in SQL comments, such as /*+ SeqScan(a) */
.
PostgreSQL's cost-based optimizer uses data statistics to estimate the costs of various execution plans and selects the lowest-cost plan. However, it may miss some data properties, such as column correlations, leading to suboptimal plans.
The pg_hint_plan
module is a Greenplum Database extension.
To activate the pg_hint_plan
module, run the following command as a superuser in a session:
LOAD 'pg_hint_plan';
Refer to the pg_hint_plan
READMEs in the GitHub repository for additional information about this module.