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 1lwqBm-00046e-10 for pgsql-performance@arkaria.postgresql.org; Fri, 25 Jun 2021 18:04:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwqBk-0004Ra-Ue for pgsql-performance@arkaria.postgresql.org; Fri, 25 Jun 2021 18:04:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwqBk-0004RS-ME for pgsql-performance@lists.postgresql.org; Fri, 25 Jun 2021 18:04:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwqBi-0006CQ-Nr for pgsql-performance@lists.postgresql.org; Fri, 25 Jun 2021 18:04:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15PI4LXq2954035; Fri, 25 Jun 2021 14:04:21 -0400 From: Tom Lane To: Ayub Khan cc: Pgsql Performance Subject: Re: slow performance with cursor In-reply-to: References: Comments: In-reply-to Ayub Khan message dated "Fri, 25 Jun 2021 19:09:31 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2954033.1624644261.1@sss.pgh.pa.us> Date: Fri, 25 Jun 2021 14:04:21 -0400 Message-ID: <2954034.1624644261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ayub Khan writes: > Is there any setting which needs to be modified to improve the performance > of cursors. Also facing slow response with reading blobs (images) from db. > Not an ideal way for storing images in db but this is a legacy application > and wanted to check if there a quick tweak which can improve the > performance while reading blob data from db. Possibly twiddling cursor_tuple_fraction would help. The default setting tends to encourage fast-start plans, which might be counterproductive if you're always fetching the entire result in one go. regards, tom lane