April 2018
Intermediate to advanced
508 pages
15h 22m
English
It's possible to disable many of the query planner's techniques, in hopes of avoiding a known bad type of query. This is sometimes used as a work-around for the fact that PostgreSQL doesn't support direct optimizer hints for how to execute a query.
You might see the following code snippet, suggested as a way to force use of indexes instead of sequential scans, for example:
enable_seqscan = off
Generally, this is a bad idea, and you should improve the information the query optimizer is working with so it makes the right decisions instead. This topic is covered in Chapter 10, Query Optimization.
Read now
Unlock full access