Re: When to use PARTITION BY HASH?

2020-06-02 Thread Michel Pelletier
On Tue, Jun 2, 2020 at 10:17 AM Oleksandr Shulgin < oleksandr.shul...@zalando.de> wrote: > Hi! > > I was reading up on declarative partitioning[1] and I'm not sure what > could be a possible application of Hash partitioning. > > Is anyone actually using it? What are typical use cases? What benef

Re: When to use PARTITION BY HASH?

2020-06-02 Thread David G. Johnston
On Tue, Jun 2, 2020 at 10:17 AM Oleksandr Shulgin < oleksandr.shul...@zalando.de> wrote: > That *might* turn out to be the case with a small number of distinct > values in the partitioning column(s), but then why rely on hash > assignment instead of using PARTITION BY LIST in the first place? > >

Re: When to use PARTITION BY HASH?

2020-06-02 Thread MichaelDBA
Hi, I use it quite often, since I'm dealing with partitioning keys that have high cardinality, ie, high number of different values.  If your cardinality is very high, but your spacing between values is not uniform, HASH will balance your partitioned tables naturally.  If your spacing between

Re: When to use PARTITION BY HASH?

2020-06-02 Thread Justin Pryzby
> To: pgsql-gene...@lists.postgresql.org, pgsql-performance@lists.postgresql.org Please don't cross post to multiple lists. On Tue, Jun 02, 2020 at 07:17:11PM +0200, Oleksandr Shulgin wrote: > I was reading up on declarative partitioning[1] and I'm not sure what could > be a possible application

When to use PARTITION BY HASH?

2020-06-02 Thread Oleksandr Shulgin
Hi! I was reading up on declarative partitioning[1] and I'm not sure what could be a possible application of Hash partitioning. Is anyone actually using it? What are typical use cases? What benefits does such a partitioning scheme provide? On its face, it seems that it can only give you a numb