PostgreSQL executes queries using cost-based optimizer, and sometimes fails to choose most optimized execution plan or some types of queries. In such cases, pg_hint_plan helps users to guide the planner to choose the plans they want by putting some nstructions - call them hints - in the comments prefixed to the SQL statement body. No need to rewrite statement tself nor change some GUC parameters elsewhere.