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 1vrpqS-008cHw-2t for pgsql-performance@arkaria.postgresql.org; Mon, 16 Feb 2026 04:04:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrpqR-003SY7-2t for pgsql-performance@arkaria.postgresql.org; Mon, 16 Feb 2026 04:04:23 +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.96) (envelope-from ) id 1vrpqR-003SXz-1t for pgsql-performance@lists.postgresql.org; Mon, 16 Feb 2026 04:04:23 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrpqP-00000000xFw-2lHg for pgsql-performance@postgresql.org; Mon, 16 Feb 2026 04:04:23 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-436e87589e8so3350772f8f.3 for ; Sun, 15 Feb 2026 20:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771214659; cv=none; d=google.com; s=arc-20240605; b=e6bCxE+fEtKMS1lJbsi6MwpsOIWJiYWqR64blCU1JjdN0WzY8b0apoC5zzjYSBKF+m QRJVCxd3AIj91ycvNmttQVtvx/9W7dWYpe4TaPSmVO6aMuSdN57GptOb2HgBr42E9GjY cycqJR9IJi5jp9HPWBN9PIrbR2JeEDugy83awh4emqvtsUeGncgyfwprTR3oVXCutMZX WQz/BStdN+nOKN55VD5D1jwKT77vDzdPQbaADUzzda9mmEtDLPPWGSPziJJlWdWcaT/L A3vSHSikijJUBGgpdi0du02Fdyktab8EPZaqkgAHwquqIRSLmY+ps4M92vUVmfEte7oP ugcA== 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=kcBY3vylEKNW4vrqQpncrV3HjjZwI+8JwuuHLfsNuE8=; fh=tBX9Ntkn1OETwWRnmZ8GzRJkOvy1X9KhrOTdn0WqwIU=; b=l3SqQ+2C7PzEwnxKZXX5J4F4ZPLO6tBQBLadGwIhQfARIkbp2jGhsV7TCvM/EP0CtG PqfwHYkcIIS2qFwuoacHP4Wfov1NGJyyFLRnqilZItEZPQt7+wKhFChvohH/ITZLTPh1 b3o+KBeBYyhKSN60V6YOtiN8+evgemLLgTFGkPfHQ/VTVhrwVLokJCSljEicZzeYAEk5 QMyStFJRdJUyKl3E5A+iXLbmKkWKwQDu3pomreW8ipX1MjBThrvxFAXBTlQFIkP+x0ev bSXCe3lX2t1e5pXEM+//NbI4jOx+pzVKCJBNSx/vBNk4pHNT0HjfE0eb+qsfNcpVj9uc pv7g==; 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=1771214659; x=1771819459; 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=kcBY3vylEKNW4vrqQpncrV3HjjZwI+8JwuuHLfsNuE8=; b=kJWhbDoSYZOH7Y6NHGdj+qWBaOqDNPPJ99kK0IB9LmpSDfbOI9QU/OPguLE1sX2Q+t lTVZjdxVW6xNmmJFnABJDubyeR9bnF1WKyBzWUduRYk2Gaf184tCOSDIgEJ6McEyjySW Z2gX51rtWfruSgmHmjnfhrLSEGLDbm9CvdOunwVqxj39G2ZYEMsgL9vQ5bvh57mykyKK Z54AoF9H4fqoVUbYqBOLgNeronHBlulz5Z5efTa9dyRbeOI7ttwndtbWVaosTg2Ohh2T knA/XSatqTEn/7Hqsnq+dFoeqH+kcSFquGNywg0Iw6jL7G9hRSkkI7IH9YopeV/YcdCW kzzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771214659; x=1771819459; 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=kcBY3vylEKNW4vrqQpncrV3HjjZwI+8JwuuHLfsNuE8=; b=a07aVyoaoTmsknd/HluAfVb9p3mLAJJcfqcD7HBP/6eWD+csW5jAhEcgP6QkbG3adZ 5BD6+x6mUXLzT1RtNrBP2ov4elvpzNgGik5WjAI5aqrbYRmIxKZfv3OqnvAuLFjz0kdj wzBHBi0f7fuss8qXL9rbOSN6P4G56ajOGlIoIh9eUTpI1pAEZYBYSzcrBVM2oazX3cfG PyAuCYhJXh6gfnXsDvNoKU71/JbFSGE+wToO6wAwaOOBckvvukuo6hDKoJ2o9hAS6pAq BJMlYwOg66aOfAb0mILfp7U+SdTxxYT9JMGna1MQKlF4TEMoyEATZusAasf9CLQJrYQP 30ZA== X-Gm-Message-State: AOJu0Ywy+gFaAcE6bKTvFX6bpO1rGTG+/MuEtOatx8ABM1dCkpkgRABz 4M7K0dBUvIutMck9vmxcfDLa4PjtzuicihHjPwPIEyqe+uKcDUwNiG02Ld3VQpfblE3oN5qhra3 PKT+gKY06yJURH48Rx9v2nJVbCys7pmNYOA== X-Gm-Gg: AZuq6aJMyb2Ase44ggiDml3VNdBUC78C7wypz/kBjWMVuDUGSR+S0z/FfE26LFNfsWS 4k/vrOuQ2mvEKKdNv7J54IpgSFyM8Lf+NZYHAoWUH5oxIwcOuIwjVoz1sGlJsSqEfi49uWTGV0J RlhIh5gQOYpUpiMUnc0KaaWaPzMs7mFIMOJgOhuze11aR2+l0JJuEXxp+xC/1hiSR1t4HCy6p7G 3Sdrn2u1rrb82lxwqlvlPTqEMb0Q6qdPJVcI9TknNUFo20kjT7wuGp9QRxso+MK/bCGrRl8HOri uWKOC+faWtYQ4WV1kSRDcSjcxeUWABkONeYi3VLiWPhBNh/Z3Rnj/rr/YEtidojqbEY+pr4SjA= = X-Received: by 2002:a05:6000:2905:b0:427:526:16aa with SMTP id ffacd0b85a97d-4379793f5edmr17096716f8f.58.1771214658461; Sun, 15 Feb 2026 20:04:18 -0800 (PST) MIME-Version: 1.0 References: <5A68A5FD-3CD2-4863-B274-51804235BE3C@softimp.com.au> In-Reply-To: <5A68A5FD-3CD2-4863-B274-51804235BE3C@softimp.com.au> From: David Rowley Date: Mon, 16 Feb 2026 17:04:07 +1300 X-Gm-Features: AaiRm51o5NnqjTtxUSOEGk1nFHIe-P7OEV2XgWpm8XTRxsp7o3Gl5g8tjtuzbWk Message-ID: Subject: Re: A serious change in performance between PG 15 and PG 16, 17, 18. To: Clive Boughton Cc: 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 Mon, 16 Feb 2026 at 16:49, Clive Boughton wrote: > When I recently upgraded to PG 18.1 (without any changes to the DB functions or tables, or indexing) it took 7-10 hours to produce the same result - a 300-600 times decrease in performance. > For reasons of security I can't provide all the SQL code, but I can (if it is necessary) provide an outline of what the code does. It will be necessary to provide more than you have done so far. There's just no way anyone could guess what might be happening based on what you've provided. I suggest looking at the EXPLAIN output and seeing if there's a plan change between the versions. Perhaps the newer version is considering a plan shape that previously wasn't considered, and that turns out not to be great due to some estimation problem. I suspect if you're seeing 300-600x slowdown, then it's pretty unlikely to be the same plan. It'd be good if you could share the EXPLAIN (ANALYZE, BUFFERS) from before and after the upgrade. Perhaps the issue is just that you didn't run ANALYZE after a pg_upgrade. David