Skip site navigation (1) Skip section navigation (2)

How to best partition table

From: "Danny Lo" <lo(dot)dannyk(at)gmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: How to best partition table
Date: 2010-04-14 01:10:24
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
Thanks Jasen for  your response to my previous question on table
partitioning on query performance. 


A related question is how I should actually setup the table partition to
best optimize performance. 

Unfortunately, my table of 20 columns will be about 1-1.5TB, much larger
than 20GB. 


Specifically, should I be using a range partition or list partition or maybe
both (ie further partitioning a child table?) and how many partitions should
I actually use. 


The table contains data for two years on a list of stocks and their stock
attributes (eg prices etc) at a particular date and time.

The majority of the queries run on this table will include the stock code &
date in the where clause.


For eg: 


select * from tablename

where stock_code = 'IBM'

and date = '17-Oct-2009'


If I were to partition by month (24 tables over 2 years), I would still have
tables around 45GB. However, I assume there is a balance between performance
and administrative overhead. 


Thanks again.


pgsql-novice by date

Next:From: Daniel HutchisonDate: 2010-04-14 02:18:07
Subject: PLPerl not installed correctly?
Previous:From: AndrejDate: 2010-04-13 19:30:46
Subject: Re: AWK script

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group