Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqDfI-0002uy-4P for pgsql-admin@arkaria.postgresql.org; Thu, 16 Aug 2018 08:29:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqDfG-0004Dl-BX for pgsql-admin@arkaria.postgresql.org; Thu, 16 Aug 2018 08:29:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fq3E4-0002k1-7D for pgsql-admin@lists.postgresql.org; Wed, 15 Aug 2018 21:21:08 +0000 Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fq3E1-0003KB-0R for pgsql-admin@lists.postgresql.org; Wed, 15 Aug 2018 21:21:06 +0000 Received: by mail-ua1-x929.google.com with SMTP id r15-v6so2445472uao.1 for ; Wed, 15 Aug 2018 14:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:date:subject:message-id :to; bh=JkTx9SeaNavLjyCJJBJrwzjMnJ2HFXSkHrhLfNGT/q0=; b=FLlKOZ1OnNBJpm4Kl4uqrsEI07U1H/Mm7WwZzk45X74dAnzOSv6iPiktCJ4vUNFPWM /KPL99brWyM1tlgBY9L0XcbAMT7p2I4gYk+4GlJUPA2Na+IykmF4mNIql6/r3zL2q331 oxMi8gzvqXdAQAuVPuaSdFFyWGLGMWq4b6E3pFDoprT1hBsrrJrmvQ1AGDfGQ5z5qqvb 4R7QquIDcYK4spz5uEy0JACXT3wC+d6YeAnYXY5KgQa2Gvy1NB2iYtB64JqdLfD+T6N/ kzf9ExttxhIoocC4gmaAoRZrTcUmzYtT+R0WFLVs5rxI9mvthmVcaGxVy7liNGR7bG22 HuuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version:date :subject:message-id:to; bh=JkTx9SeaNavLjyCJJBJrwzjMnJ2HFXSkHrhLfNGT/q0=; b=JBe2dFIv+1UthjSVKQnwfuws2lE8bnS+WNglEFwvxCkTpza0nYkaTX0cfI6uVLyIyh FEsJOFAZ2izN2/8Zmu83nHoBHWfu2xFcZubwy037ADoA+NxdxOVk4kSViQDHYR7urrou 6gIAG/oq6o6iw81QbNiitDPyukvOMSFH6W+apvUB94m/Xf6sA+CaTfR48CZQB6kreibE KLDpPfUxmtL5dbJNWuTTuH30UgBg0XUhy9Y5YVvGDHxD0HsmxP22KDL9rPoxjMLZwXeB DGcPwwb+18p23Thjex1N/RvTKKUl3LBWp0XoHu4OPcg7DGRxMBhmSJ3FOvFcPz94IaGb FnFA== X-Gm-Message-State: AOUpUlFkGF51+lOPlALFIh9qdygnZQXoxVOdkc+DJN0RguNre6GeNbuJ mBx8UtRumIzwrLTP7WtU4vgtZb9L X-Google-Smtp-Source: AA+uWPwoByfknCdzrO3gqgy+9XfL3cFb4nikycoemefD3lizhVuQLnFdU+7Lgo0YNxo5ZcqiwGqZHw== X-Received: by 2002:ab0:559d:: with SMTP id v29-v6mr18081668uaa.174.1534368063418; Wed, 15 Aug 2018 14:21:03 -0700 (PDT) Received: from [172.16.3.133] ([67.148.93.60]) by smtp.gmail.com with ESMTPSA id f16-v6sm3662468ual.42.2018.08.15.14.21.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 14:21:02 -0700 (PDT) From: Natalie Wenz Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Wed, 15 Aug 2018 16:21:00 -0500 Subject: Cursors Message-Id: <0E01B4A9-D944-4300-8A56-FC14DFFAB999@gmail.com> To: pgsql-admin@lists.postgresql.org X-Mailer: iPhone Mail (15G77) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I have a couple of general questions regarding cursors.=20 First, does something like this hold open one transaction, or is each fetch a= separate transaction? As a dba I'm wondering if this would interfere with m= aintenance operations (xid rolling via autovacuum, attaching/detaching parti= tions, etc). declare cursname no scroll cursor without hold for ... fetch forward 50000 from cursname Secondly, on this particular thing (it's a three-table join, with one of tho= se tables being very "wide", so there's definitely a pg_toast table that's i= nvolved besides), it seems to perform pretty terribly. What are the advantag= es of gathering records this way compared to doing a series of queries with a= range (record number >=3D x and record number < y)?=20 Thanks for your help! Natalie=