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 1tk3cR-00H0u3-EO for pgsql-general@arkaria.postgresql.org; Mon, 17 Feb 2025 16:05:15 +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 1tk3cP-00HBjs-IH for pgsql-general@arkaria.postgresql.org; Mon, 17 Feb 2025 16:05:13 +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 1tk3cP-00HBjj-6t for pgsql-general@lists.postgresql.org; Mon, 17 Feb 2025 16:05:13 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tk3cM-001NDh-22 for pgsql-general@lists.postgresql.org; Mon, 17 Feb 2025 16:05:12 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7be49f6b331so444209785a.1 for ; Mon, 17 Feb 2025 08:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739808309; x=1740413109; 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=hs2JG35lQcW/NUokRIjq8pv4X73LMi10CuYpR6URPS4=; b=a+ahltiOyU+15ADcKnAdFhajp+vNup1W0PKflCLQXp2AdbPyk3wcgdaT60pyDiDeDy QuFj3OyJGhLSCYM3EPedyYYWwe7ENGuu1RXSQNgVgzrlShrABgDDqD0ejzVMd7q/dwMI V06pb1QeollYl073aEBOXcSBFZbX9fv6qtlHr52aBZZzddjU1d6/Ve+1bZCNyVdkSkLY I3yI2iZpsStoyS/egvSF8V1NVLiidYT0/lJT6uzP/lJGvqr+QR67jB9WuHKDQQX21qe5 xdAIF3dM2ssRWUnbDZvgx2ZRzt5gD7AqKNFjf62oLgabxfDL8iJChBtcRBgtdM8dg1f8 cIAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739808309; x=1740413109; 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=hs2JG35lQcW/NUokRIjq8pv4X73LMi10CuYpR6URPS4=; b=sbXzX33vUOhg+1NUju3EXfxHgFC+L2hKASQOE48GkP9pRhb5vOgU/eN11UDh+hMrjY CACUX4jKLE6IWPK4+tuY4ny0ekevCxR4EpNvRSYxqHD6aGb1d2SIPQE9szJ9jMB3MyG1 4IpCqoVX/M2/5xXhQlfmQiEpSKah+t6jMJoDJ+zOU4Pdt1wXU0ghFxkIoLbaDdPQXp0I Zp6A2n+L+oY/FtXqOqoIebnOtRBpmh+QN+JHfKaSLO1tifBXcwar616jkS2S5YG2qfA8 fAJBvXSmLPZQT8PH3lnA/UyWJzklcAShE7wMn2sR11CvyZlacDWsrSBevB9JLPZ1yV91 UxAw== X-Forwarded-Encrypted: i=1; AJvYcCXVtZJqRsUmny+QXQoYDMzoNHt8Eqp0wTMcvSIRnT/hWNWGS5hnSq2srDRQ7rmgW1o2haFWhIr2EUmeK9eE@lists.postgresql.org X-Gm-Message-State: AOJu0YyHt5ML499fbcy14wvJBxCOnlZxuJiDLSOW4VtC/xcT97eFmkRo O6KLIRmnDD7oYBIfkS7l8n1QMRWH/+ikq16eAqXM5mLnSCu1VZdLRRaCVRTX2ef3I+ADvnBLBTK CmhZxOGNM5SmEWHUqguxFdQQzxrA= X-Gm-Gg: ASbGnct5uhKcrV9Nc/6f+KDVcW6zy3b4elIsaBNAYsHifJnpp1djvHyqQR2N35yjfqk AlAj18X/A78qKhgZMprKc4VDiuvYFnp/u0amzu8xWNq77xx37/vrzwcsXMR7XFMnW6onGTyUvO9 hGKyw1PNMkM5pQSp1+4Lk4kfSR0sTa+bc= X-Google-Smtp-Source: AGHT+IHm1E97NgF1iPO6b0Y2ULo45P1tx3olQUVbiTnrUVK9UppWOSZyXi/sN/G+NpTNL7xzOBidqyR3OwmHWyCL1lM= X-Received: by 2002:a05:620a:2993:b0:7c0:855f:468 with SMTP id af79cd13be357-7c08a9dd5f0mr1677756285a.25.1739808308671; Mon, 17 Feb 2025 08:05:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Doron Tsur Date: Mon, 17 Feb 2025 18:04:57 +0200 X-Gm-Features: AWEUYZl_PkDsN-qxL8TkfxdBrNGrEcOyE9tbJuYPJAIoqEGboSRH0NBvcY9ufQ4 Message-ID: Subject: Re: The performance issues caused by upgrading PostgreSQL to version 16.3. To: Greg Sabino Mullane Cc: =?UTF-8?B?6aasIOmosOmjmw==?= , "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000373de6062e58b046" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000373de6062e58b046 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable post installing, did you run analyze verbose? -Doron On Mon, Feb 17, 2025 at 4:23=E2=80=AFPM Greg Sabino Mullane wrote: > 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. Ca= n > 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 > > --=20 --- Sent with Gmail for Sidekick Browser --000000000000373de6062e58b046 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
post installing, did you run analyze verbose?=C2=A0
-Doron=C2=A0


On Mon, Feb 17, 2025 at 4= :23=E2=80=AFPM Greg Sabino Mullane <htamfids@gmail.com> wrote:
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:
Interestingly, when we isolate the problematic SQL statement and repla= ce 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 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



--
---
Sent with Gmail for Sidekick Browser
--000000000000373de6062e58b046--