Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elJId-0006Wu-1Q for pgsql-jdbc@arkaria.postgresql.org; Mon, 12 Feb 2018 18:57:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elJIb-0006Xy-Sz for pgsql-jdbc@arkaria.postgresql.org; Mon, 12 Feb 2018 18:57:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elJIb-0006Xo-NU for pgsql-jdbc@lists.postgresql.org; Mon, 12 Feb 2018 18:57:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elJIY-0005rf-OI for pgsql-jdbc@postgresql.org; Mon, 12 Feb 2018 18:57:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1CIvoXY001922; Mon, 12 Feb 2018 13:57:50 -0500 From: Tom Lane To: Vladimir Sitnikov cc: Jaime Soler , Dave Cramer , Brad DeJong , List Subject: Re: ResultSet storing all rows with defaulftFetchSize to 5000 In-reply-to: References: <3558.1518451137@sss.pgh.pa.us> <5505.1518453548@sss.pgh.pa.us> Comments: In-reply-to Vladimir Sitnikov message dated "Mon, 12 Feb 2018 18:50:25 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1920.1518461870.1@sss.pgh.pa.us> Date: Mon, 12 Feb 2018 13:57:50 -0500 Message-ID: <1921.1518461870@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Vladimir Sitnikov writes: > The backend materializes, so it is a sad thing. > Is there a change "with hold" can be implemented without materialization? That would not be an improvement. If we didn't materialize, then we'd have to retain the locks held by the transaction, as well as keep global xmin from advancing, so that the rows the cursor still needed to fetch would not get cleaned by VACUUM nor would the tables containing them get dropped or significantly altered. Either effect would be awful for performance if the cursor was held for long. Moreover, keeping the locks would effectively mean that the transaction wasn't really ended. So if that's what you want, don't commit the transaction. regards, tom lane