pganalyze · youtube · en-US
1pg_hint_plan influences query plans by modifying global settings and copying internal Postgres code to alter path generation.
“pg_hint_plan works by basically putting in a query comment in the beginning of your query, it says something like sequential scan on "a" and pg_hint_plan then does some quirky things to make this work. So the quick gist of how it works is, hint plan basically does a combination of influencing Postgres settings as in, you know, global settings that influence query plans, like "enable_seqscan", and then it also copies a bunch of code.”