Improvements in PostgreSQL 9.6

Two things that changed in the most recent release of PostgreSQL are both associated with deferring certain actions to the remote server. In PostgreSQL 9.6, JOIN and ORDER BY operations are actually transmitted to the remote system, though there are some restrictions:

  1. Joined foreign tables exist on the same SERVER. In our case, this would be primary_db.
  2. The remotely joined tables must be distinct. Our third query example was a self-join which is unfortunately not supported by the pushdown logic.
  3. We don't want to sort and join at the same time.

 

Basically this means we could create pgbench_branches as a foreign table and joining it with pgbench_accounts would be done by the remote system. We could also sort ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.