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 1lwCjv-00034x-3y for pgsql-general@arkaria.postgresql.org; Wed, 23 Jun 2021 23:57:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwCjt-0000LH-4w for pgsql-general@arkaria.postgresql.org; Wed, 23 Jun 2021 23:57:01 +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 1lwCjs-0000L9-Sf for pgsql-general@lists.postgresql.org; Wed, 23 Jun 2021 23:57:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwCjq-0005Nj-DU for pgsql-general@lists.postgresql.org; Wed, 23 Jun 2021 23:57:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15NNusq92550777; Wed, 23 Jun 2021 19:56:54 -0400 From: Tom Lane To: David Rowley cc: Alvaro Herrera , Rumpi Gravenstein , PostgreSQL Subject: Re: Partitioned Table Index Column Order In-reply-to: References: <202106232255.3gmtpm5lzc2p@alvherre.pgsql> Comments: In-reply-to David Rowley message dated "Thu, 24 Jun 2021 11:53:29 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2550775.1624492614.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Jun 2021 19:56:54 -0400 Message-ID: <2550776.1624492614@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Thu, 24 Jun 2021 at 10:55, Alvaro Herrera w= rote: >> It is not relevant from the partitioning point of view. Other factors >> can be used to decide the column order. > I'm not so sure that's really 100% true. There is at least one > partitioning feature that will work when the partitioning column is > first and won't when it's not. > Ordered partition scans work with RANGE and LIST partitioning: Sure, but is that any different from the behavior with unpartitioned tables? You have to make the index column order agree with the ORDER BY you want to use, in either case. regards, tom lane