Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t415Y-00FxX3-DO for pgsql-admin@arkaria.postgresql.org; Thu, 24 Oct 2024 16:53:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t415W-005X59-Oy for pgsql-admin@arkaria.postgresql.org; Thu, 24 Oct 2024 16:53:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t415V-005X40-4Q for pgsql-admin@lists.postgresql.org; Thu, 24 Oct 2024 16:53:30 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t415R-002le8-EB for pgsql-admin@lists.postgresql.org; Thu, 24 Oct 2024 16:53:28 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id ED74C1140121; Thu, 24 Oct 2024 12:53:22 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 24 Oct 2024 12:53:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1729788802; x=1729875202; bh=KxK0H8dnjuQisxjPtY77gVVUCArth8Sz 1QBBlLgSqx0=; b=d7kN4OcXAR6JB2uw8x3Es/xYJPt92Q2UNVaVSl9tb+WmtaEH j/5otxWo56dUyqoMjTDXCpnKW26yF5+KcXsy91Rwi0LKVAM56eCpehE7YA2x5+tj 0D0UFYJUg/LdCBW+dzFj2W0ey9H4m00UwpWaQEwdGcPDQTb8/8W7sxn6XGMBPzgK 1WJa8uEEC98Kzz2EjGJNjoeItegIV00SCW72SDI1lYjlt+swdjccnOIGAbLkBoYB 4R5ByyCNJLjawaEnZqMZ7sV8FrNj2Dr41lAHcP7OJFe5hPeHO0IfhGQHkZfre8Oo FCcJTGla3wGjG/3jtra2TUQ/da/ReCN6p9K+sg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1729788802; x=1729875202; bh=KxK0H8dnjuQisxjPtY77gVVUCArt h8Sz1QBBlLgSqx0=; b=KOI7t/X37X95OYCR3Lz3MmEuDFY1L6KoTk6v6nIb+YCh kcdVyiY++tcExRX1dEo2bf0RPkMl6ERSfvHEHKY0QkUVVb5yCjttNteZHlW08H2E JKfs65LCsxWifzYRPonfBurjFljyjQDkE+mNZ2Zz76bfWiR6PWjhg/Lrm6PxSn4Y +xFLtqAdcEFrCHJk9GwBAz44NoCKuLYFIgUVxNdHNayf3p70Vs5OSR+5lmT923Gv +QNaR/+Fk5HFs07zsTICrVx/MI9U19KpQjges5K/E5bvpyMCbOJb3DnK2MzKKlmn vBeHa4+R6s14p0W66isfkV25Oa+8UqqWyMCBtkHyOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdejtddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fvhffutgfgsehtkeertddtvdejnecuhfhrohhmpefusghosgcuoehssghosgesqhhurggu rhgrthhumhdqsghrrggttggrshdrtghomheqnecuggftrfgrthhtvghrnhepfeekhefftd ffleduudegkeevtdekvdejgfegheefteefudeiveekhfelfffhuefhnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgsohgssehquhgrughrrg htuhhmqdgsrhgrtggtrghsrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhm thhpohhuthdprhgtphhtthhopehpghhsqhhlqdgrughmihhnsehlihhsthhsrdhpohhsth hgrhgvshhqlhdrohhrghdprhgtphhtthhopehssghosgesqhhurggurhgrthhumhdqsghr rggttggrshdrtghomh X-ME-Proxy: Feedback-ID: i374947ac:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Oct 2024 12:53:22 -0400 (EDT) Message-ID: <31a09bff-78df-468b-8783-4bb5ebc8c0c9@quadratum-braccas.com> Date: Thu, 24 Oct 2024 10:53:20 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: "pgsql-performance@lists.postgresql.org" Content-Language: en-US From: Sbob Subject: Partitioned table scanning all pertitions when the where clause specifies the partition key Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk All; I created a table that includes a lastname column that is a varchar(50) : CREATE TABLE customers ( cust_id      bigint, custinfo   text, cust_dob   date, lastname   varchar(50), firstname varchar(50), custaddr   varchar(200), city            varchar(100), state        varchar(100), zipcode   varchar(5) )  PARTITION BY LIST (lastname) ; Then we created 4,000 partitions with each partition hosting a specific set of lastname's (each partition has 100 lastname's) The partitions are all based on UPPER(lastname) like this: CREATE TABLE cust_part1 PARTITION OF customer FOR VALUES IN ('SMITH', 'JONES','REX', 'ROBINSON', 'ROBINSON JR' ... ) and all the partitions have been loaded up with all the data that lines up with the partition key (100 lastnames per partition) Each partition has an INDEX on upper(lastname) When I run something like : EXPLAIN SELECT * FROM customers where lastname = 'BORRIS'; The explain plan does an index scan on each partition even though constraint_exclusion os set to "partition" Thanks in advance for any advice