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 1rni60-00EepS-T1 for pgsql-sql@arkaria.postgresql.org; Fri, 22 Mar 2024 16:50:21 +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 1rni5z-005Lts-F3 for pgsql-sql@arkaria.postgresql.org; Fri, 22 Mar 2024 16:50:19 +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 1rni5z-005Ltk-6Y for pgsql-sql@lists.postgresql.org; Fri, 22 Mar 2024 16:50:19 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rni5w-005sqD-4L for pgsql-sql@lists.postgresql.org; Fri, 22 Mar 2024 16:50:18 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6ea838bf357so558596b3a.0 for ; Fri, 22 Mar 2024 09:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711126216; x=1711731016; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=VygdzsSknCA/PfK1gnlxdK5t/6WC+USLxfwzK5ixs5k=; b=PUyCSwugU3n73AMcukfuxNdLr/b7jPQkK20tEL8867SSdOWbDWezjLexFdYJs5pYOr XLD82TFb2tUrVLLTBhqW04+WM7sZqLHLJkxG5tN/HkmAvBLpEJiOOQF+XlaaD7ZKa95O sRunzN1LsMUgLqbnOvpXmUjp2ZPDS/MsPNtuwnG7flJEccjEEXI5D35ODx5G+RlkeFfK 4/FD/KRb98DSwA2kffNYALIObP5G3aRkBnzrbndJWrsC8KBU+4EPlNJ/UsispHlYkBA7 L8cYKm0p5eSrvsIx1WM/bImdbO6dl6g2UI4wpOqeFgceuJamVehkWWmh344TUcWHz1bD xBPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711126216; x=1711731016; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VygdzsSknCA/PfK1gnlxdK5t/6WC+USLxfwzK5ixs5k=; b=SZleNX3TRJscEq3ZmHM5GQ/zAs6xK5+yj5qCYr8LKtHEWZf9d149jtfaVplK2fQBl7 7OEy4shbnychLufT8gEgwe/j0dAJkih588+cTeLp3SzQa/VFuqCMyV7+kRhQbK3ER04f oD/g541DrcUhYmAxIaAnoDp4MANonf+Yauv7+YU6YuBur6lNdFS2mq+ogq0bQPSXWn0E EMkL8dBeAr+0cwyruL7JqdhgaBivBXLc7v3Hfw1BIDiDs2l5XIu1ytNiKO4A5pgSjGVB AR5e0HNASwlFoE7/6yiUE+eZoTlFMGNa+uTzlAleII04+UN477+037p5LstymJufsl3K LuSg== X-Gm-Message-State: AOJu0Yy3Qn3c97Er3bG9ZaFGiWogarCCFhoM9Db1g4VmsyBjj1j9mnPP URmZWssaAf13AStn8SaE/cuA6Ww+g3e4reK2udDtvOry2LHjNxCNdahfDmwAySIgG+yww0JvE5+ ueL29OStXAJknBvI+zlR877DU3/QZh2ad3EQ= X-Google-Smtp-Source: AGHT+IEgbUDxPIlTN4KODLvoMtO218tC4IYfz3FMi43ZKvQT7QHHet3SndTcEgk8qE/ZsSaWM/kA2g6lnzViBfcFzfM= X-Received: by 2002:a17:90a:6bc5:b0:29b:277d:2585 with SMTP id w63-20020a17090a6bc500b0029b277d2585mr204941pjj.20.1711126215978; Fri, 22 Mar 2024 09:50:15 -0700 (PDT) MIME-Version: 1.0 From: Bindra Bambharoliya Date: Fri, 22 Mar 2024 22:20:04 +0530 Message-ID: Subject: Cursor with hold for select takes too long To: pgsql-sql@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000044f5fd0614429ef3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000044f5fd0614429ef3 Content-Type: text/plain; charset="UTF-8" Hi team, I am facing issues with cursor with hold for select. If I execute select quaery without cursor it takes 13 seconds, If execute it like Begin; Cursor "sql1" with hold for select.... ;fetch 100 to "sql1" It takes more than 3 minutes. Even sometimes it takes more than 10 minutes. What could be the problem? Request to help on this ASAP. I am facing this issue on production. I checked locks etc. But nothing like that. Thanks & Regards Bindra --00000000000044f5fd0614429ef3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi team,
I am facing issues with cursor = with hold for select.

If= I execute select quaery without cursor it takes 13 seconds,
If execute it like=C2=A0
Begin;
Cursor "sql1" with hold for select.... ;fetch 100 to= "sql1"
It takes more than 3 minutes.
Even sometimes it takes more than 10 minutes.

What could be the problem?
Request to help on this ASAP.
I am f= acing this issue on production.=C2=A0
I checked lock= s etc. But nothing like that.


Thanks=C2=A0& Regards
Bindra
--00000000000044f5fd0614429ef3--