Re: Partition tables in AWS RDS environment

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Partition tables in AWS RDS environment
Date: 2017-04-10 14:25:13
Message-ID: B75CD08C73BD3543B97E4EF3964B7D7047B49034@CITESMBX1.ad.uillinois.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Do you happen to know...
In 9.6 if you do a pg_dump on a schema and you have a few very large tables in the schema will this cause the database to lock the table for writing?

This is an issue I ran into with older version of PostgreSQL using pg_dump on entire schemas. To get around this issue I partitioned the really large tables so that the locking would be a much shorter time period while running pg_dump. But this may not be necessary with 9.6

Thanks,

Lance

-----Original Message-----
From: Stephen Frost [mailto:sfrost(at)snowman(dot)net]
Sent: Monday, April 10, 2017 8:57 AM
To: Campbell, Lance <lance(at)illinois(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Partition tables in AWS RDS environment

Greetings, Lance,

* Campbell, Lance (lance(at)illinois(dot)edu) wrote:
> My group is planning on moving our PostgreSQL install to AWS. We plan to use their RDS option for running PostgreSQL. When we make this move is there any reason to use Partitioned Tables on really large tables? Will we get any performance gain?

This really depends on what you're doing, exactly. Generally speaking, I find that partitioning is great for data management (you're able to get rid of an entire partition at a time, based on your retention policy, for example) and it isn't what you look to for improving individual query performance. Having smaller tables can make things a bit easier for autovacuum, but 9.6 also has improvements that can make VACUUMs much less painful (the all-frozen visability bit in the VM).

> I know we would get a performance gain on really large tables if we partitioned them and put their partitions in different table spaces that use different disks. However since we are looking at using the more generalized hands off automated AWS RDS PostgreSQL option I don't see us using table spaces and different disks. So would there be any gain in partitioning tables in the more automated AWS RDS PostgreSQL path?

This really depends on what your queries are doing. It's not necessairly a guarantee that a given query will perform better if the table is split up into partitions and spread across tablespaces.

In short, there isn't a simple answer to that question.

Thanks!

Stephen

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Stephen Frost 2017-04-10 14:31:18 Re: Partition tables in AWS RDS environment
Previous Message Stephen Frost 2017-04-10 13:57:23 Re: Partition tables in AWS RDS environment