Re: Patch: Global Unique Index

Поиск
Список
Период
Сортировка
Искать
От
Vik Fearing
Тема
Re: Patch: Global Unique Index
Дата
Msg-id
ae3b677b-7f62-6c6a-bd54-53579f057ae1@postgresfriends.org
Ответ на
Список
Дерево обсуждения
Patch: Global Unique Index Cary Huang <cary.huang@highgo.ca>
Re:Patch: Global Unique Index Sergei Kornilov <sk@zsrv.org>
Re: Patch: Global Unique Index Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch: Global Unique Index Thomas Kellerer <shammat@gmx.net>
Re: Patch: Global Unique Index Pavel Stehule <pavel.stehule@gmail.com>
Re: Patch: Global Unique Index Thomas Kellerer <shammat@gmx.net>
Re: Patch: Global Unique Index Cary Huang <cary.huang@highgo.ca>
Re: Patch: Global Unique Index Vik Fearing <vik@postgresfriends.org>
Re: Patch: Global Unique Index Laurenz Albe <laurenz.albe@cybertec.at>
Re: Patch: Global Unique Index Vik Fearing <vik@postgresfriends.org>
Re: Patch: Global Unique Index Laurenz Albe <laurenz.albe@cybertec.at>
Re: Patch: Global Unique Index Pavel Stehule <pavel.stehule@gmail.com>
Re: Patch: Global Unique Index Pavel Stehule <pavel.stehule@gmail.com>
Re: Patch: Global Unique Index Ilya Anfimov <ilan@tzirechnoy.com>
Re: Patch: Global Unique Index Dilip Kumar <dilipbalaut@gmail.com>
Re: Patch: Global Unique Index Justin Pryzby <pryzby@telsasoft.com>
Re: Patch: Global Unique Index Dilip Kumar <dilipbalaut@gmail.com>
Re: Patch: Global Unique Index Dilip Kumar <dilipbalaut@gmail.com>
Re: Patch: Global Unique Index Simon Riggs <simon.riggs@enterprisedb.com>
Re: Patch: Global Unique Index Cary Huang <cary.huang@highgo.ca>
Re: Patch: Global Unique Index Bruce Momjian <bruce@momjian.us>
Re: Patch: Global Unique Index David Zhang <david.zhang@highgo.ca>
Re: Patch: Global Unique Index Greg Stark <stark@mit.edu>
Re: Patch: Global Unique Index Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch: Global Unique Index David Zhang <david.zhang@highgo.ca>
Re: Patch: Global Unique Index Bruce Momjian <bruce@momjian.us>
Re: Patch: Global Unique Index Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch: Global Unique Index Cary Huang <cary.huang@highgo.ca>
Re: Patch: Global Unique Index David Zhang <david.zhang@highgo.ca>
Re: Patch: Global Unique Index Nikita Malakhov <hukutoc@gmail.com>
Re: Patch: Global Unique Index David Zhang <david.zhang@highgo.ca>
Re: Patch: Global Unique Index Greg Stark <stark@mit.edu>
Re: Patch: Global Unique Index Cary Huang <cary.huang@highgo.ca>
Re: Patch: Global Unique Index Nikita Malakhov <hukutoc@gmail.com>
Re: Patch: Global Unique Index Bruce Momjian <bruce@momjian.us>
Re: Patch: Global Unique Index Bruce Momjian <bruce@momjian.us>
On 11/24/22 19:15, Cary Huang wrote:
>   ---- On Thu, 24 Nov 2022 08:00:59 -0700  Thomas Kellerer  wrote ---
>   > Pavel Stehule schrieb am 24.11.2022 um 07:03:
>   > >     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.
>   >
>   >
>   > My personal opinion is, that a global index should never be created
>   > automatically.
>   >
>   > The user should consciously decide on using a feature
>   > that might have a serious impact on performance in some areas.
> 
> 
> Agreed, if a unique index is created on non-partition key columns without including the special mark (partition key columns), it may be a mistake from user. (At least I make this mistake all the time). Current PG will give you a warning to include the partition keys, which is good.
> 
> If we were to automatically turn that into a global unique index, user may be using the feature without knowing and experiencing some performance impacts (to account for extra uniqueness check in all partitions).

I disagree.  A user does not need to know that a table is partitionned, 
and if the user wants a unique constraint on the table then making them 
type an extra word to get it is just annoying.
-- 
Vik Fearing



В списке pgsql-hackers по дате отправления
От: Simon Riggs
Дата:
От: Chris Travers
Дата:
FAQ