Re: When to use PARTITION BY HASH?

2020-06-08 Thread David Rowley
On Tue, 9 Jun 2020 at 01:07, Ron wrote: > > On 6/8/20 3:40 AM, Oleksandr Shulgin wrote: > [snip] > > I've found the original commit adding this feature in version 11: > https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1aba8e651ac3e37e1d2d875842de1e0ed22a651e > It says: > > "Hash

Re: When to use PARTITION BY HASH?

2020-06-08 Thread Ron
On 6/8/20 3:40 AM, Oleksandr Shulgin wrote: [snip] I've found the original commit adding this feature in version 11: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1aba8e651ac3e37e1d2d875842de1e0ed22a651e It says: "Hash partitioning is useful when you want to partition a

Re: When to use PARTITION BY HASH?

2020-06-08 Thread Oleksandr Shulgin
On Sat, Jun 6, 2020 at 6:14 PM Michel Pelletier wrote: > > Well lets take a step back here and look at the question, hash > partitioning exists in Postgres, is it useful? While I appreciate the need > to see a fact demonstrated, and generally avoiding argument by authority, > it is true that

Re: When to use PARTITION BY HASH?

2020-06-06 Thread Ron
On 6/5/20 8:51 AM, Jeff Janes wrote: On Fri, Jun 5, 2020 at 6:12 AM Oleksandr Shulgin mailto:oleksandr.shul...@zalando.de>> wrote: [snip] For a bulk load you'd likely want to go with an empty partition w/o indexes and build them later, after loading the tuples. That only works if

Re: When to use PARTITION BY HASH?

2020-06-06 Thread Michel Pelletier
On Wed, Jun 3, 2020 at 4:55 AM Oleksandr Shulgin < oleksandr.shul...@zalando.de> wrote: > > Do you also assign the partitions to different tablespaces as you've > hinted below or do you see performance improvement from partitioning > alone? How does that work? Does it give better results than

Re: When to use PARTITION BY HASH?

2020-06-05 Thread Jeff Janes
On Fri, Jun 5, 2020 at 6:12 AM Oleksandr Shulgin < oleksandr.shul...@zalando.de> wrote: > On Thu, Jun 4, 2020 at 4:32 PM Jeff Janes wrote: > >> On Wed, Jun 3, 2020 at 7:55 AM Oleksandr Shulgin < >> oleksandr.shul...@zalando.de> wrote: >> >> With hash partitioning you are not expected, in

Re: When to use PARTITION BY HASH?

2020-06-05 Thread Oleksandr Shulgin
On Thu, Jun 4, 2020 at 4:32 PM Jeff Janes wrote: > On Wed, Jun 3, 2020 at 7:55 AM Oleksandr Shulgin < > oleksandr.shul...@zalando.de> wrote: > > With hash partitioning you are not expected, in general, to end up with a >> small number of partitions being accessed more heavily than the rest. So

Re: When to use PARTITION BY HASH?

2020-06-04 Thread Jeff Janes
On Wed, Jun 3, 2020 at 7:55 AM Oleksandr Shulgin < oleksandr.shul...@zalando.de> wrote: With hash partitioning you are not expected, in general, to end up with a > small number of partitions being accessed more heavily than the rest. So > your indexes will also not fit into memory. > > I have

Re: When to use PARTITION BY HASH?

2020-06-03 Thread Oleksandr Shulgin
(sticking to pgsql-general) On Tue, Jun 2, 2020 at 7:45 PM Michel Pelletier wrote: > > On Tue, Jun 2, 2020 at 10:17 AM Oleksandr Shulgin < > oleksandr.shul...@zalando.de> wrote: > >> >> I was reading up on declarative partitioning[1] and I'm not sure what >> could be a possible application of

Re: When to use PARTITION BY HASH?

2020-06-03 Thread Oleksandr Shulgin
On Tue, Jun 2, 2020 at 7:47 PM Stephen Frost wrote: > > Please don't cross post to multiple lists without any particular reason > for doing so- pick whichever list makes sense and post to that. > Sorry for the trouble, I should've checked it more carefully. When posting I did think it may be

Re: When to use PARTITION BY HASH?

2020-06-02 Thread Stephen Frost
Greetings, Please don't cross post to multiple lists without any particular reason for doing so- pick whichever list makes sense and post to that. * Oleksandr Shulgin (oleksandr.shul...@zalando.de) wrote: > I was reading up on declarative partitioning[1] and I'm not sure what could > be a

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

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

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