Skip to Main Content
PostgreSQL 10 High Performance - Third Edition
book

PostgreSQL 10 High Performance - Third Edition

by Enrico Pirozzi
April 2018
Intermediate to advanced content levelIntermediate to advanced
508 pages
15h 22m
English
Packt Publishing
Content preview from PostgreSQL 10 High Performance - Third Edition

Partitioned queries

Now that the data is in the partitions, it's a good idea to update statistics. It's also important to confirm that the constraint_exclusion feature is active:

ANALYZE;
SHOW constraint_exclusion;
 constraint_exclusion 
----------------------
 partition  

constraint_exclusion allows the query planner to avoid including partitions in a query when it can prove they can't provide useful rows to satisfy it. In PostgreSQL 8.4 and later, the default value of partition turns this on, when partitioned tables are referenced, and off otherwise. In earlier versions, it defaults to off. You will have to turn the parameter on once you start using partitions in earlier versions if you expect them to work properly.

Queries against the whole ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL: Up and Running, 3rd Edition

PostgreSQL: Up and Running, 3rd Edition

Regina O. Obe, Leo S. Hsu
Learn PostgreSQL - Second Edition

Learn PostgreSQL - Second Edition

Luca Ferrari, Enrico Pirozzi
PostgreSQL, Second Edition

PostgreSQL, Second Edition

Korry Douglas, Susan Douglas

Publisher Resources

ISBN: 9781788474481Supplemental Content