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.96) (envelope-from ) id 1vsV0c-0048QQ-0o for pgsql-performance@arkaria.postgresql.org; Wed, 18 Feb 2026 00:01:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vsV0b-00DB5n-1n for pgsql-performance@arkaria.postgresql.org; Wed, 18 Feb 2026 00:01:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vsV0b-00DB5a-0q for pgsql-performance@lists.postgresql.org; Wed, 18 Feb 2026 00:01:37 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vsV0Y-000000018Q8-3fID for pgsql-performance@postgresql.org; Wed, 18 Feb 2026 00:01:36 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-4327790c4e9so3526249f8f.2 for ; Tue, 17 Feb 2026 16:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771372894; cv=none; d=google.com; s=arc-20240605; b=N+cBnylzuh5aLE6eVCza4nT1FPSGwY+eQ3OrnBmeXW2nz7+KsxFD/s//Om5KBSdVBv i06pqh4PpXEOnBKsqiS/DytqhWe4swxU1BoY2LWpw+vSvjuvWIAwW9mwHZqxlmOAZ2vs vcNPBxe45oQcnms3LMFMbzpYw8GonLLg3dtLHOjSCt44UacUoukRMcNUvj+VqcGU2bzE m9nmPSg1Dl9izYroYwcNizU96BcOgdTt9FJHC8KpD/qmmsb+flOXjIUS6LLi3mpt17n1 9gZjQSbKSycPNPq0AAKMKY2Lr1gO9iuWKqHGi8hWyOXJ0R9aH/xuT+lImnOR8TUHfZNc sE/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=K4UhL00rbeaFXDoGxllXse4a5UjSq8q9Er19h62cQWk=; fh=BDpZYHTCQXHt982goWTlQvu+tgHuYgDPqP/ny8n69wA=; b=F2HTIgtmjnj6V+AxRW2LFwqyXRGHOHQJ2djbxfPQBIq+RVeiyL6RA2UU8ETDLzW4f4 DcJAQaJnZZoIOXZrjwEonelsY4TZvwymMn1f6RS/qLpPvMdYSQpdaUou/9yxs4WiVfN1 nf6BJkJTnYrOv7MulONWRjTZnS37geV0RXeGsSd2h7RHN9kAXlZ7Al+8zGSaEU71Ehny m0Vbybg+5GaklkNKVEHFFsZwLi7uWnnnuTqKOmdftw9Ho8JfbXLEDDB+qOSQv2sBk+cw gvTEq6hncximSj+/5M3rHApNAdEHUiwg3evkmSfDfYFjCsiMPEt0epEAPY74cjYd5Abp es5g==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771372894; x=1771977694; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K4UhL00rbeaFXDoGxllXse4a5UjSq8q9Er19h62cQWk=; b=UxJxiNMGHu5MJfzux0Z080qndA1a9I1Q3f1K7llQn3VriW6VInIQYRWtPwCET2l+e/ Kja28rKATZmdlHs36kc/aYnRP/rGvFO6oYDVSMVjiF6zdDyNemj5iI4RrRShn93yTGdA e9+OkYC03L3eEICF98GYi17rJFGdbzzUDFRkIaaBHuJlHda65ryEehlr2rhIZwvL89Kd 45sSoIVw3ORvfMIup9Xs+rODhELZjsXCBHUTbyY01/jNwfr4ukQDAPgxEy3xK0xXnTq7 PbAVZda+biyqbD1J2Nyy6mMG7iI3BCicgC5/NzHu2xqNoRw68UWntfS7gkpDby/VgT9C 3r9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771372894; x=1771977694; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=K4UhL00rbeaFXDoGxllXse4a5UjSq8q9Er19h62cQWk=; b=Ro1tNv5qwsR5/VDdXjRLHfh/Lud3fCnWHQkFPlqtwRkmFcp9/lnb21Ggt1GN1Z7YA8 xQfQzQrFUJgJRcMABv/zFXmOc4dQz8G3nr6Vs/ryJk41c1P5XXAVuVJUFgOY0vxItvJF F3st6kCRsTd0fq8lIGg3hrXsuPPfgDO36yqCcMwjmqv0GbMj7Qi+Gex8v744h2NTF49d fGVvNrr1wusx6jXKvAUiEZ9ENeI6XzfqEawj08V2alvs1YFEVSLBXCXKQg9+OX5BphmV kkbRnVfvdYCX7kq6puJTUehMXTDWmL4YbRH58Q1CaAQdUyO0V1Y0m93v43x00QrruOOF jeJg== X-Forwarded-Encrypted: i=1; AJvYcCVc+YLvVOAIP06ZO5frAFYWvhEHen3Nyk4w052S3fc8h8VE2LO7aSDHz+MtJ5UP1GP1BGOFAFPCD0RfEOMSRfm3jw==@postgresql.org X-Gm-Message-State: AOJu0YyuIzBle18A1qQDYgf1xJG3AtsFspIH7zrjE4nNskUuvQFZYPAA +xJYxOvHZkkBaOPTcxM/neCvXC18M/ZHq7LbP4LGdiebMSSd+rH7it2YcEEBm3jg6lUnV4PIRUS FXHi2SdWRLMD25LbkIrZL/YLgiMFOUmMt4Q== X-Gm-Gg: AZuq6aIc2cd3uFanVYVdy9F9AKoC6n1t3YBB5Q4qonCy3IbJbtoFo44qQpvE+8CxMwt lvEtwVf16u3HbS+joE3rAanZawdMjWIxdWi7Nry2Hu123pOMa7G7JHO3qLRWuMZd0yAFFb6pA2P PDzD+ifiKOYQa0ezGR+9joCwx3jdT/KXwPbrNigDmA30RwKHs90ZciBImclYEeGse9AvAWPiSNA 1hLJLzgtj/UX2LM/MexJ98Bs3OhtoP4YV6Z8MbmEtKnj5etlSPx/HwKJf4MusPyebhWxuPDmiUK ru8/EwcF/q3S6zjqEx5qYo3yhWaHvJoS01xotyoqzzxfOzOBORhsVgyYdT4UDYypbggZGzNjeg= = X-Received: by 2002:a05:6000:1aca:b0:436:7a5:aac with SMTP id ffacd0b85a97d-43796a3bc1amr24419506f8f.0.1771372894010; Tue, 17 Feb 2026 16:01:34 -0800 (PST) MIME-Version: 1.0 References: <5A68A5FD-3CD2-4863-B274-51804235BE3C@softimp.com.au> In-Reply-To: From: David Rowley Date: Wed, 18 Feb 2026 13:01:22 +1300 X-Gm-Features: AaiRm53jGDQRwnyMjCJt6AnxPDSNhgfg6DF4doDxBwpAnBx0rahop0SEKVzd9is Message-ID: Subject: Re: A serious change in performance between PG 15 and PG 16, 17, 18. To: Joe Conway Cc: Clive Boughton , pgsql-performance@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 17 Feb 2026 at 04:42, Joe Conway wrote: > Are some of your indexes on collatable columns? If so, what version of > glibc is on each of your systems (i.e. did you change OS major versions)? For the record, Clive did send me the query and EXPLAIN output offline. I asked him if he'd anonymise it and post it here, but no response yet. I'll just describe what I saw so as not to share details that Clive isn't happy making public. The query is to a single table, no joins. The filter is equality on an INT column. The v15 plan uses a Seq Scan and runs in 175ms. v18 is using a Bitmap Heap Scan using the table's primary key index. The PK must be a composite key and the WHERE clause must be on the first column of that key. That query runs in 305ms, so more like x2 rather than the reported 300-600x. v18 estimates slightly fewer rows than v15, so that might be why it switched plans to the bitmap heap scan. That could be down to random sampling from ANALYZE finding fewer rows that match the query's WHERE clause in v18. I'd recommend Clive to try running ANALYZE on the table and seeing if the plan changes. Repeat that a few times to see if the Seq Scan plan is ever picked. I'd also check if the random_page_cost and seq_page_cost settings are the same on both instances and ensure enable_seqscan is on. David