开发者

How to partition a master table?

Now,am using the postgresql .In our master table nearly 1,000,000 records .we already create the index of this table but it will slightly improve the performance.So we will decide to partition the table.we think it is the right way 开发者_开发知识库to increase the performance..

What I need:

How to partition the table in Postgresql ? What are the steps am i should follow ?


Why do you think you need to partion your table? I would start to find out what the problem is, why your queries are too slow. Start using EXPLAIN ANALYZE to see how a query is executed and what might be the problem. Could you show us the queryplan?

A million records is not that much, unless each record is very large.


See section "5.9.2. Implementing Partitioning" in POSTGRESQL's help documentation about partitioning: http://www.postgresql.org/docs/9.1/static/ddl-partitioning.html

I found this article incredibly informative when it comes to putting together partitioned tables. I would also agree with everyone else that 1M records should still be fast without a partition. Your index(es) may not be getting used on your queries but that would be the topic for a separate question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜