From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Thomas Kellerer <shammat(at)gmx(dot)net> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: Patch: Global Unique Index |
Date: | 2022-11-24 06:03:24 |
Message-ID: | CAFj8pRCXadc7aCdcYKG-CP-v8q5rpoXLEGbH8z13g-3X4Y6MKQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
st 23. 11. 2022 v 23:42 odesílatel Thomas Kellerer <shammat(at)gmx(dot)net> napsal:
> Tom Lane schrieb am 18.11.2022 um 16:06:
> >> Do we need new syntax actually? I think that a global unique index
> >> can be created automatically instead of raising an error "unique
> >> constraint on partitioned table must include all partitioning
> >> columns"
> >
> > I'm not convinced that we want this feature at all: as far as I can
> > see, it will completely destroy the benefits of making a partitioned
> > table in the first place. But if we do want it, I don't think it
> > should be so easy to create a global index by accident as that syntax
> > approach would make it. I think there needs to be a pretty clear YES
> > I WANT TO SHOOT MYSELF IN THE FOOT clause in the command.
>
> There are many Oracle users that find global indexes useful despite
> their disadvantages.
>
> I have seen this mostly when the goal was to get the benefits of
> partition pruning at runtime which turned the full table scan (=Seq Scan)
> on huge tables to partition scans on much smaller partitions.
> Partition wise joins were also helpful for query performance.
> The substantially slower drop partition performance was accepted in thos
> cases
>
> I think it would be nice to have the option in Postgres as well.
>
> I do agree however, that the global index should not be created
> automatically.
>
> Something like CREATE GLOBAL [UNIQUE] INDEX ... would be a lot better
>
Is it necessary to use special marks like GLOBAL if this index will be
partitioned, and uniqueness will be ensured by repeated evaluations?
Or you think so there should be really forced one relation based index?
I can imagine a unique index on partitions without a special mark, that
will be partitioned, and a second variant classic index created over a
partitioned table, that will be marked as GLOBAL.
Regards
Pavel
>
> Just my 0.05€
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Julien Rouhaud | 2022-11-24 06:37:23 | Re: Allow file inclusion in pg_hba and pg_ident files |
Previous Message | Hayato Kuroda (Fujitsu) | 2022-11-24 05:26:27 | RE: wake up logical workers after ALTER SUBSCRIPTION |