O'Reilly logo

PostgreSQL High Performance Cookbook by Dinesh Kumar, Chitij Chauhan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required