Re: Scaling PostgreSQL-9

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Scaling PostgreSQL-9
Date: 2010-09-28 12:15:31
Message-ID: AANLkTinnvAX79gmbKQ7jvKQZVsoL3H3CC=Z29V_Z0nT7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 28, 2010 at 6:31 AM, sandeep prakash dhumale <
sandy9940(at)rediffmail(dot)com> wrote:

> I have a table with 400M records with 5 int columns having index only on 1
> column.
>

How is your data used? Is the update done by the primary key? Are the
queries segmented in some way that may divide the data based on one of the
other columns?

You should investigate using partitions to hold your data. I'd recommend at
least 100 partitions. I've done this with great success by dividing some
tables along one of the foreign keys. My table was just a pure relation
relating the PKs of two other tables. After analyzing the queries that were
most often run, we decided to split along the one which resulted in the
fewest partitions being referenced per search.

By splitting, we reduced a 200M+ row table into 100 tables of ~2M rows, and
the constraint exclusion (or altering the queries to directly access the
proper partition) reduced our query times dramatically.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2010-09-28 12:27:12 Re: ECPG - Some errno definitions don't match to the manual
Previous Message Allan Kamau 2010-09-28 11:35:09 Re: huge difference in performance between MS SQL and pg 8.3 on UPDATE with full text search