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 1tk222-00GTGG-Lt for pgsql-general@arkaria.postgresql.org; Mon, 17 Feb 2025 14:23:34 +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 1tk220-00GMXj-UN for pgsql-general@arkaria.postgresql.org; Mon, 17 Feb 2025 14:23:32 +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.94.2) (envelope-from ) id 1tk220-00GMX9-Ed for pgsql-general@lists.postgresql.org; Mon, 17 Feb 2025 14:23:32 +0000 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tk21w-001JTA-0u for pgsql-general@lists.postgresql.org; Mon, 17 Feb 2025 14:23:29 +0000 Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-3d1987cce10so24990185ab.3 for ; Mon, 17 Feb 2025 06:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739802207; x=1740407007; darn=lists.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=6plMBPNaI4cLvGllXXpr71XC80rs5OE/2yi2wT7HqMM=; b=YPIyMUZGkJ7mekioqU3cFpk/YgdVJmsOivnIEZnUM0FFTBn8Viol3qEmDvrr3FmuW9 gd+2YnwMOjCTspCba5y0CrmkTl049Awz3C3ZptQjLhLGfjNtwGKlse6WhZJGbD3v/5kO WXZtyhazPcITXmVwCRkfcSkoi9EWS3ZHUGa401V6FE0/sxvsNwE17i11piyHUpQQ24gq VHwJ9GnT/+ROzXryk2NVi55vNFvINE3F7jNEzh/RDFvQoVE71aFNSxWBZpUhRYJAy17b BJ/s5OBmt942HTEwFQHNv/UhVxXktMsrLlyiH9p/GQzMkh+iTxQ/peaIEigZrekAEX1G rg5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739802207; x=1740407007; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6plMBPNaI4cLvGllXXpr71XC80rs5OE/2yi2wT7HqMM=; b=rnxIF0QHjLU+BqMqjX2PX/76fm/Ry6ZloB5fFHm/LVAbNtZKvQNlkjebiVvy13T44C g2bSoSKQzPkx7Dt5XYk0bxjNIHS8byoTcdTGJqbVGAuij2b7H5utnifknZ0y6NbT81lp cXiMHUeQSatL6wN8TVhIDVQlS8N3w6VnrYTITHKiduj5UVc7bBuAOHh1W6UCDU7rM0gd ad7HQDG9p49i9AoX+UqvPy3OLP9SEzrZOpId8AR4T3H98XBeNotLat20X40G4bxAsfUB +zbgZ0E5U53es3nUvXsFOt67mZe2ibBGBk5qausiad2dFh4Q0uw8vbgZGMtpg8f28ExC VdaA== X-Gm-Message-State: AOJu0Yz+mC9y8UVKyMZGWWZGjdNHqGL9ZcEAQI9y/fEDPjusNgdspBYx 0yNLGL0mmyVSyF+tpQHcfVnoFjwx3IpTRmZ5kTuUO86w5PE32H+WUNkJBza7O1q+sn9w+I8hPVK 22CKWR0ybbMhHoKOjkTaITBdlWME6UA== X-Gm-Gg: ASbGncsZm75aw0SLAVUqLTToHTRHe6vf4I4q9uAlYDSsDgQDvARC66NPKgVG0jvO2Hp UNbK0m13EyV3b+dOSagbvt7bP35H8i1Jd6+9tUr1NWkuh2TWYASv1v0msL0MuY8BmarWo9FAOSS /VkKhRcRgiDfaugfMXgfXczy9+y80feuc= X-Google-Smtp-Source: AGHT+IEh+FiykAidekWVqYJK7cmxlaZtekORimPHT233lVgavjAXcYCAoH63lmwpIpP6e46Na1oVf5J1QrkDxrcZBYk= X-Received: by 2002:a05:6e02:240b:b0:3d2:75bc:730 with SMTP id e9e14a558f8ab-3d2809d9587mr84780385ab.19.1739802207341; Mon, 17 Feb 2025 06:23:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Mon, 17 Feb 2025 09:22:50 -0500 X-Gm-Features: AWEUYZkjQA7ve2r6lg7SeAtKikapV6FW12XXNmryL1Kvx7HgSLKX3rlgeGNhYAM Message-ID: Subject: Re: The performance issues caused by upgrading PostgreSQL to version 16.3. To: =?UTF-8?B?6aasIOmosOmjmw==?= Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000008c5827062e5744d5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008c5827062e5744d5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 17, 2025 at 2:55=E2=80=AFAM =E9=A6=AC =E9=A8=B0=E9=A3=9B wrote: > Interestingly, when we isolate the problematic SQL statement and replace > its parameters with actual values, it executes in just a few seconds in > pgAdmin. > However, when we run the same SQL query through our application using > Npgsql, it takes over ten minutes to complete. > Another reason could be a poor type casting by your driver/middleware. Can you share the query that is problematic? (also, since you mentioned a version upgrade, also make sure you run ANALYZE; post-upgrade.) Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --0000000000008c5827062e5744d5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Feb 17, 2025 at 2:55=E2=80=AFAM = =E9=A6=AC=E3=80=80=E9=A8=B0=E9=A3=9B <ma-tengfei@nec.cn> wrote:
Interestin= gly, when we isolate the problematic SQL statement and replace its paramete= rs with actual values, it executes in just a few seconds in pgAdmin.
However, when we run the same SQL query through our application using Npgsq= l, it takes over ten minutes to complete.

Another reason could be a poor type castin= g by your driver/middleware. Can you share the query that is problematic? (= also, since you mentioned=C2=A0a version upgrade, also make sure you run AN= ALYZE; post-upgrade.)

Cheers,
Greg
=

--
Enterprise = Postgres Software Products & Tech Support

--0000000000008c5827062e5744d5--