Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pnLNl-0001SF-CE for pgsql-general@arkaria.postgresql.org; Fri, 14 Apr 2023 15:30:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pnLNk-00016o-95 for pgsql-general@arkaria.postgresql.org; Fri, 14 Apr 2023 15:30:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pnLNj-00016f-RW for pgsql-general@lists.postgresql.org; Fri, 14 Apr 2023 15:30:35 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pnLNg-002smE-8o for pgsql-general@postgresql.org; Fri, 14 Apr 2023 15:30:35 +0000 Received: by mail-ej1-x634.google.com with SMTP id qb20so46107354ejc.6 for ; Fri, 14 Apr 2023 08:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1681486230; x=1684078230; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=DvgzVlb/ucyI/l6aFfXvirMCG7NHXz/AaJONl35bCo4=; b=yG8+BrCJh1PxiDMMmCbWXGIqMvYisD676ZjvKCLikJCdUexkKdAvwVbuVYsSV57Tns 0ve9vbIMsOHMSGYRqXT40QQMSCZPjpUiHU+h7XB21ASihKmMnlrAo0egqWGioXPn2D+3 W7q+A442M133Wn+QPk+ZCBjoTImi6UKcu2b4dxcjnOkBqE3yWWU0ikJLmedsQ0jvlX8c I8b23JLadQ2e+YwHGWCHOtzydxs6l4ZFcQbyxHQfa5cCBaZQQOKIG7q4wchZd+yg/M6k 3ZJM3faAIKZjQ529f3DwMgcvC09JZj+PAcL/0aD0SGF4eND77gj1szDw8eMHtpI1Hyae PXSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681486230; x=1684078230; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DvgzVlb/ucyI/l6aFfXvirMCG7NHXz/AaJONl35bCo4=; b=gwX/oi5m+0roAdrwILqMpvmFqoD1+XRn7JK3S4ew6vHg7O3EM2pnFe+5fzzpBacJ/w 12T9A4HP/vOgOjeGSFSKMz74jpBYKhZEimxtrzucyLo3ur8C3/DluNewtDyqgUl0G6jm hM2X6O92Yu5g6DYMULh2iA1sSlJkJT6/yPaSYEaQL7XB+Ik2kqQQlbXDsG46z9YZAcI2 VwMV2b6U/dD+r69cVNB65U+OxOZLa18/BUI5qAxRYlgBq8pKy4ipBhq6luBYB/091wP3 V5oHV2B8zCpsJZGtctagK6hYmhvW9rG5fvlHME6gxx4KyVfvmpBaqVJgweS8GsV7z6BZ 5ytg== X-Gm-Message-State: AAQBX9cJZYn94mcTM2HgF+uPQZ49YsLYUEg0LPq1LEd4m/IVmdFkwy3l YhcTyxVDfHgIR+lk3mhng/OiqgUCdhxI0B++dsk= X-Google-Smtp-Source: AKy350a9ZUk8WvcQ16W69aPWP1Z0/WijarxLpF2Oh00b04S94MwytDsN3zGoiZm8H2gpDplSh+Vulg== X-Received: by 2002:a17:906:70d1:b0:92d:145a:6115 with SMTP id g17-20020a17090670d100b0092d145a6115mr7939871ejk.38.1681486230049; Fri, 14 Apr 2023 08:30:30 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:2041:3416:d5a1:81ba:12ac]) by smtp.gmail.com with ESMTPSA id q13-20020a1709066acd00b0094e44445f30sm2548904ejs.215.2023.04.14.08.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 08:30:29 -0700 (PDT) Message-ID: <2c62dd64316c1cf8b49bb4298603a73488e5d7be.camel@cybertec.at> Subject: Re: cursor with hold must be save to disk? From: Laurenz Albe To: =?UTF-8?Q?=E9=BB=84=E5=AE=81?= , pgsql-general@postgresql.org Date: Fri, 14 Apr 2023 17:30:29 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-04-14 at 19:04 +0800, =E9=BB=84=E5=AE=81 wrote: > i want to use cursor with hold ,but when I declare a curosr , it takes a = long > time to save the result set to disk. can i save the query state in memory= ? > and fetch forward the next result. The complete result set has to be materialized. It only spills to disk if = it is large. That cannot be avoided. Yours, Laurenz Albe