TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Implement table partitioning

190 pointsby rachbelaidover 8 years ago

11 comments

samchengover 8 years ago
Any support for &quot;rolling&quot; partitions? e.g. A partition for data updated less than a day ago, another for data from 2-7 days ago, etc.<p>I miss this from Oracle; it allows nice index optimizations as the query patterns are different for recent data vs. historical data.<p>I think it could be set up with a mess of triggers and a cron job... but it would be nice to have a canonical way to do this.
评论 #13130206 未加载
评论 #13129998 未加载
评论 #13131743 未加载
rachbelaidover 8 years ago
The conversation on the patches are really interesting: <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;flat&#x2F;55D3093C.5010800@lab.ntt.co.jp#55D3093C.5010800@lab.ntt.co.jp" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;flat&#x2F;55D3093C.5010800@...</a> <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;flat&#x2F;ad16e2f5-fc7c-cc2d-333a-88d4aa446f96@lab.ntt.co.jp#ad16e2f5-fc7c-cc2d-333a-88d4aa446f96@lab.ntt.co.jp" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;flat&#x2F;ad16e2f5-fc7c-cc2...</a>
评论 #13129661 未加载
egeozcanover 8 years ago
If you also didn&#x27;t know what exactly partitioned tables are, here&#x27;s a nice introduction from Microsoft:<p><a href="https:&#x2F;&#x2F;technet.microsoft.com&#x2F;en-us&#x2F;library&#x2F;ms190787(v=sql.105).aspx" rel="nofollow">https:&#x2F;&#x2F;technet.microsoft.com&#x2F;en-us&#x2F;library&#x2F;ms190787(v=sql.1...</a><p>It is for the SQL server but I assume it would be mostly relevant. Please correct me if I&#x27;m wrong.
评论 #13129853 未加载
ktopazover 8 years ago
I don&#x27;t get it? Table partition is already supported in PostgreSQL now and has been for a long time now (at least since 8.1); Where I work we utilize table partitioning with PostgreSQL 9.4 on the product we&#x27;re developing.<p><a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;current&#x2F;static&#x2F;ddl-partitioning.html" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;current&#x2F;static&#x2F;ddl-partition...</a>
评论 #13129766 未加载
评论 #13130268 未加载
评论 #13130950 未加载
评论 #13130254 未加载
tajenover 8 years ago
About donations: I believe PostgreSQL now deserves more advertising and marketing to develop its adoption in major companies and, hence, get more funding. If I donate on the website, it says it will help conferences. Where should I donate?
bigatoover 8 years ago
Supposing the case in which all partitions are on the same disk and that you manage to index your data well enough according to your usage that postgres does not need to do full table scans, are there any additional performance benefits on partitioning?
评论 #13132151 未加载
评论 #13132481 未加载
评论 #13140108 未加载
评论 #13130760 未加载
gdulliover 8 years ago
This message was confusing to me because I&#x27;ve been using&#x2F;abusing Postgres inheritance for partitioning for so long that I forgot Postgres didn&#x27;t technically have a feature called &quot;partitioning&quot;.<p>What I&#x27;m looking forward to finding out is if I can take an arbitrary expression on a column and have it derive all the same benefits of range partitioning like constraint exclusion.
vincentdmover 8 years ago
I really like this addition. We store a lot of data for different customers, and most of our queries are only about data from a single customer. If I understand it correctly, if we would partition by customer_id, once the query planner is able to take advantage of this new feature, it will be much faster to do such queries as it won&#x27;t have to wade through rows of data from other customers.<p>Another common use case is that we want to know an average number for all&#x2F;some customers. To do this, we run a subquery grouped by customer, and then calculate the average in a surrounding query. I hope that the query builder wil eventually become smart enough to use the GROUP BY clause to distribute this subquery to the different partitions.
tdaover 8 years ago
I just tried to implement table partitioning in PostgreSQL 9.6 this week. With some triggers and check constraints this seem to work quite nicely, but I was a bit disappointed that hash based partitioning is currently not possible (at least not without extensions).<p>Will hash based partitioning be included in PostgreSQL 10? The post notes<p><pre><code> A partitioning &quot;column&quot; can be an expression. </code></pre> so I can assume it will be supported?
评论 #13130221 未加载
评论 #13130176 未加载
amitlanover 8 years ago
...this is the beginning, not the end... <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;CA%2BTgmobTxn2%2B0x96h5Le%2BGOK5kw3J37SRveNfzEdx9s5-Yd8vA%40mail.gmail.com" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;CA%2BTgmobTxn2%2B0x96h...</a>
vemvover 8 years ago
While seemingly extensive, I don&#x27;t quite like the commit message.<p>I doesn&#x27;t say what TP <i>is</i>, and what its use cases would be. That&#x27;s the first thing you should say, else how am I going to understand &#x2F; keep interest in the rest of the text?
评论 #13129879 未加载