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 1m2sgG-0002PZ-O6 for pgsql-performance@arkaria.postgresql.org; Mon, 12 Jul 2021 09:56:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2sgF-000174-Lm for pgsql-performance@arkaria.postgresql.org; Mon, 12 Jul 2021 09:56:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2sgF-00016P-DU for pgsql-performance@lists.postgresql.org; Mon, 12 Jul 2021 09:56:51 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2sgD-0006QE-3P for pgsql-performance@postgresql.org; Mon, 12 Jul 2021 09:56:50 +0000 Received: from ANAT ([78.197.128.121]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.168]) with ESMTPSA (Nemesis) id 1MXotA-1ldgI945lc-00Y8wa; Mon, 12 Jul 2021 11:56:42 +0200 From: "Michel SALAIS" To: "'David Rowley'" , "'Nagaraj Raj'" Cc: "'Christophe Pettus'" , References: <20210708221703.GA1301@telsasoft.com> <202107082228.obnak7c7mx4n@alvherre.pgsql> <080901d7744e$ac0f3d70$042db850$@runbox.com> <613808845.2913413.1625801566230@mail.yahoo.com> <5B9DB883-EED5-4378-ABEC-03FCC11560B2@thebuild.com> <859150623.3882063.1626050211237@mail.yahoo.com> In-Reply-To: Subject: RE: Partition column should be part of PK Date: Mon, 12 Jul 2021 11:56:40 +0200 Message-ID: <00a501d77704$371708f0$a5451ad0$@msym.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQEl2keVU7R58lp6jrYpCcwCAGqjQAI0b0d+AfEmqX8CTnmBjAH9JnBEAfJ4TRkCVrD4qqw8fC7Q Content-Language: fr X-Provags-ID: V03:K1:Nh1W3xxnzjbERxMsK9BG+RVntDMz7jT5MSS+CGZkkfNhMsgDJYz r7PRSYdd1/JegmZpLj6WWT6ffg1RmonZN49EmKkYCdKQ4oY7tCjDs+Gh4IZn8lZCYeVA36b KJ4ytOXupgFpIYAfyt2Mw7vVPH0dmCSgcoOhrywKOT/CqDVQKFA+wvlfhaw8w/rtcXVmR6/ eeg98R9sCCTSpQoMCb4aw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:2vYqhIeopno=:AMYIa3Wk2okPcjFx/570vn vBJcX69FyxnbMTwCitwTc4NCBlUi6r+a0izOXqs1GcPQk4A57uw5qVNvv94o6XoLlsoDgZrgM +PVDOkzWU+qN2EOJhSoYlVtB7QESxAa65d70RxFBtGrT1U36bOdUFtHQd+m9fEm2/1urJFRKN Zyp2N3YJMDmfyWv57SJskQcvB87LqF2CijHY2GIfmaD2zDEtLXZRVhu8eNstg8LzO2oB+0UZS EA7YD2wLZUmb1mc+NbMz5lFyHcX6wK0sUT4aiNE+zcAFpBXcCFnxNbLb0E/1tOxaDXcOO8eZU ONmVXf9WTBKPnnmB5kr01KHf4AWGhthKkj5MsUW9uJJ3nXjkSpXjDx5leEjX+qrBVWmkTn64q tlbfK+ACQufue1JL0K7Xyn7LM2yI6t7HvDwqT6kqesr+6EOSRcD0mUggWxXjox0Dd/TTITjbn eJ4juarY9EeLlZqd8iRt1qc8vusoQKePVTzC1zuXURMyayVgkyLCWf1oWCKg3EcdZKGLUnqG2 AtuVuvNR/iSkDOtD2BTbCQRI6zqSEHxPSrW4pSTM/4EdXyOsHqa4N+mVrjgCrsCj96W1y2I0Z 2f9HZ/QPAOROBA7+JUQU28NIORaRMPpdVEuHDDwMhb8Xx9etSNJ1c0nhrFN7WDITOKlAxx9Np +ZUTQcqDL9B8jLd8NmQgAfCSJNc/wW9pTqrtPxltkMHG9x/5QL2YfL67GxjVwiMpz0hRDK9be 4icfvAStIkgJ6xTg1j38n5Nv9Nu4SqtfdgvwPLHg1wPP49BfYvnWFUdZmBeet2o1yS4Mk2RJX IN7kEQ3lEwF0/PDzc6GByCCC/rYsQd/otsmenPDHrHTEbnNthjvT3+qpaxUZShwjR5B/4fu List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi all, I think that global indexes could be useful sometimes. That is why = Oracle implements them. Just to mention two benefits that could be required by a lot of people: - Global uniqueness which shouldn't be in conflict with partitioning - Performance! Well, when index is on a column which is not the = partitioning key. A global index would be better for performance... Nevertheless, this doesn't go without any price and you have described = this very well. That is why Oracle invalidates global indexes when some = partitioning maintenance operations are achieved. These indexes have to = be rebuilt. But, anyway, such operations could be done "concurrently" or = "online"... Michel SALAIS -----Message d'origine----- De : David Rowley =20 Envoy=C3=A9 : lundi 12 juillet 2021 02:57 =C3=80 : Nagaraj Raj Cc : Christophe Pettus ; = pgsql-performance@postgresql.org Objet : Re: Partition column should be part of PK On Mon, 12 Jul 2021 at 12:37, Nagaraj Raj wrote: > personally, I feel this design is very bad compared to other DB = servers. I'm not sure exactly what you're referring to here as you didn't quote = it, but my guess is you mean our lack of global index support. Generally, there's not all that much consensus in the community that = this would be a good feature to have. Why do people want to use = partitioning? Many people do it so that they can quickly remove data = that's no longer required with a simple DETACH operation. This is = metadata only and is generally very fast. Another set of people = partition as their tables are very large and they become much easier to = manage when broken down into parts. There's also a group of people who do it for the improved data locality. Unfortunately, if we had a global index feature then that requires building a single index over all = partitions. DETACH is no longer a metadata-only operation as we must = somehow invalidate or remove tuples that belong to the detached = partition. The group of people who partitioned to get away from very = large tables now have a very large index. Maybe the only group to get = off lightly here are the data locality group. They'll still have the = same data locality on the heap. So in short, many of the benefits of partitioning disappear when you = have a global index. So, why did you partition your data in the first place? If you feel = like you wouldn't mind having a large global index over all partitions = then maybe you're better off just using a non-partitioned table to store = this data. David