Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyDiu-0001dG-11 for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Nov 2022 15:01:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oyDis-0004PR-Sy for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Nov 2022 15:01:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyDis-0004PH-IT for pgsql-hackers@lists.postgresql.org; Thu, 24 Nov 2022 15:01:06 +0000 Received: from mout.gmx.net ([212.227.15.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyDin-000425-Mq for pgsql-hackers@lists.postgresql.org; Thu, 24 Nov 2022 15:01:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1669302060; bh=ao5ym/tzcquykaa5IVgyiYUfEyBXi+MoK5r6U+nWlAY=; h=X-UI-Sender-Class:Subject:Cc:References:From:Date:In-Reply-To; b=QrS3FQMXm2gAEa1os02txiTZ7BufwSnI54trLTYOmVaoqU4k72sb6K698DsorJyxQ cXqM7zt8A92mByc8qGHyPdjqDyxtsfuI6ay885p674H6/zkcYJrZNloAabuqNSzDmb p/4czo3kXLYUlhq7OANv9kh4lgpS3N9PeU9wa9nxhZ7rH9LzPoGbVAkGDizi10PeKP zo94qTSGeIafCsh5rIoQgi+SyA8ufPpnedDcKgbXL8dIJ/ImRP/YCaUxPVQjL5Av4V 1cFd2UVBMem+OJQp4nsjwEsMhFihztraPknWXjiiLxYcROsCGOsYkO7/LgSdFgbN6/ 6q6U6YQs87AJg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [10.1.34.15] ([185.40.248.10]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MatRZ-1pUGHf1BUZ-00cQXS for ; Thu, 24 Nov 2022 16:01:00 +0100 Subject: Re: Patch: Global Unique Index Cc: pgsql-hackers@lists.postgresql.org References: <184879c5306.12490ea581628934.7312528450011769010@highgo.ca> <3866851668762233@ja6lqgzbqb6tniny.sas.yp-c.yandex.net> <2187643.1668783992@sss.pgh.pa.us> <6cdcb7b1-2567-1373-79d1-96467a9b305b@gmx.net> From: Thomas Kellerer Message-ID: Date: Thu, 24 Nov 2022 16:00:59 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:z7djDx6SOZYqQW59YCi0AsP8tO+OYsWaLyass6iCoC93GY1uHIV PekIEjMiRasSNSQcMidvy7V35tLiy+I6DKzml/WFtw4g9ojhwJGEz5GBFIXBkyiL9r/n2mm mmz5UuECFCfLCiHxIhgy5xUpZ40neveW6chSvWCCVJKNetlvKlJPMHzwx68FLvGKJ2nVxCj 1CvwhNcGLIzv5x07cRbEA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Qg/yw/gBPN8=;vapu0Ph6oDG1xc00O7k5zTlL9rQ aiEZBUGxVOJ7bB8teCYxitYpfbWmEyWEi8tuRxv8WE2zQWQUQj6MBkVq+AzlraPRUc0xVTkJc ATy4M4mqxgfg9ahUbUSuF6MJrrkSviTmRCu4aKaxOAtI/RZJPxim70DhPjHCU0gmHHyDzJ/67 NzESYphAsqwi/e79fceMaLUHRWHWRsFjAJIbEmrfW+lhTGwz5jc0yHTX3OXL+ViCzTXPhUV9W CCfgaNby1iMqtzzFPNYle8neE7yrEB7VkRkQPzoI70SPGBX3wa/ZN3QsHfdtgWu2fORb6nkT5 CofMLsQa8jGSShkjhQqnPEZ+j9z5SrXmhSGrQ4dNEB+6hIpyAymd0Z3ucx7qbEweSiPWssMV4 gxZo4aTycsD2eD64nHeiQQp0mkD/9bhh9YRXcRygddUVXiGQE+WSfCPqgiw8XVEoBhwDwySKL NsSVUNy/rGs0muTyKok0MIxjIvRUiSQZ76cOlD2hfDtbKdm3LrpNYSdnJJHgMOrSRDJbxZDDq sW+Q0Ns5xciEgZqnxRCodAUSjYhVEGhW1R8bBYiWu8x8bUl1qJYf1FgoPYxgJUOALwaSSoxp7 YKtIe60nl/xRZFMlYlLX216WESR8QKP1fozOEdz10a/nyU3PQ1aCWx0tjdKLeY0k+5T4FVwNM a/TIo59d+fsPAHCTsNwYaPmaMfaln48lSaD/R6sfgrOg5qELlkpU8EOKBEgha0DO7vYz/1rWa zhOZj4LR1gK1+/X9kA5P8I1XITzBfadQZ5PvvUNsMj/sJfGS+OfZZLqBS3JQqSgZqUQcK4TVJ bJTCosjXZ8dybNQ1c2r3i/q714McwckP9S74pGTvRg2Sd+fLrqDjqhannmVeju3OSx3v8+k3D pvu1Tv4rjIfkMFpxHiuWxnmRB0ti999kqS/uUk8nIeYf1Yn+yo+FpleL+FRiZCpHlU6dsGo6m 4PDVVQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 (=3DSe= q 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 auto= matically. > > Something like CREATE GLOBAL [UNIQUE] INDEX ... would be a lot bette= r > > > 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.