dbTalk Databases Forums  

index on a partitioned table

comp.databases.postgresql comp.databases.postgresql


Discuss index on a partitioned table in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Greg Hennessy
 
Posts: n/a

Default index on a partitioned table - 08-16-2012 , 12:48 PM






I am using postgresql 8.1.3 on redhat, and trying to use partitioned
tables to manage a multi-terabyte table. I've created the parent table
and the child tables.

If I want to add an index, does it matter if I index the parent or the
collection of children? I can't find a discussion of the pros or cons
on this in the documentation.

Reply With Quote
  #2  
Old   
Robert Klemme
 
Posts: n/a

Default Re: index on a partitioned table - 08-17-2012 , 04:11 AM






On 16.08.2012 19:48, Greg Hennessy wrote:
Quote:
I am using postgresql 8.1.3 on redhat, and trying to use partitioned
tables to manage a multi-terabyte table. I've created the parent table
and the child tables.

If I want to add an index, does it matter if I index the parent or the
collection of children? I can't find a discussion of the pros or cons
on this in the documentation.
To me this seems pretty clear: indexes are not automatically inherited
and the master table is usually empty => index child tables. It's all
in the docs:

http://www.postgresql.org/docs/8.1/s...NHERIT-CAVEATS
http://www.postgresql.org/docs/8.1/s...titioning.html

Cheers

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Reply With Quote
  #3  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: index on a partitioned table - 08-17-2012 , 02:31 PM



On Thu, 16 Aug 2012 17:48:53 +0000, Greg Hennessy wrote:

Quote:
I am using postgresql 8.1.3 on redhat, and trying to use partitioned
tables to manage a multi-terabyte table. I've created the parent table
and the child tables.

If I want to add an index, does it matter if I index the parent or the
collection of children? I can't find a discussion of the pros or cons on
this in the documentation.
In Postgres, parent table is usually empty. You can only index child
tables. And there are no global indexes, it isn't possible to have a
unique index across all the tables.



--
Mladen Gogala
http://mgogala.freehostia.com

Reply With Quote
  #4  
Old   
Jasen Betts
 
Posts: n/a

Default Re: index on a partitioned table - 08-17-2012 , 07:30 PM



On 2012-08-16, Greg Hennessy <greg.hennessy (AT) cox (DOT) net> wrote:
Quote:
I am using postgresql 8.1.3 on redhat,
Upgrade! But seriously, upgrade. 8.1.23 at a minumum.

Quote:
and trying to use partitioned
tables to manage a multi-terabyte table. I've created the parent table
and the child tables.

If I want to add an index, does it matter if I index the parent or the
collection of children? I can't find a discussion of the pros or cons
on this in the documentation.
you need to add it to each of the children that will benefit from
having it. usually this means all of them.

indexing the parent will bave no possitive effect, the database knows it's
really empty

you're going to want to turn constraint excluusion "on" if you haven't
alredy. (8.1 doesn't have a 'partition' setting for constraint exclusiin)
upgrade to someting newer like 9.1 for improved performance.

--
⚂⚃ 100% natural

--- Posted via news://freenews.netfront.net/ - Complaints to news (AT) netfront (DOT) net ---

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.