Partitioning with PL/Proxy

In this recipe, we are going to cover horizontal partitioning with PL/Proxy.

Getting ready

PL/Proxy needs to be installed on the host machine. Refer to the previous recipe for more details on installing PL/Proxy.

How to do it...

The following are the steps that need to be carried out for horizontal partitioning using PL/Proxy:

  1. Create three new databases: one proxy database named nodes, and two partitioned databases, nodes_0000 and nodes_0001, respectively:
            postgres=# create database nodes; 
     
            postgres=# create database nodes_0000; 
     
            postgres=# create database nodes_0001; 
    
  2. Once you have created these databases the next step is to create a PL/Proxy extension:
            psql -d nodes         nodes=# create extension ...

Get PostgreSQL High Performance Cookbook 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.