pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>
Cc: Richard Huxton <dev@archonet.com>
Cc: Pgsql-Performance (E-mail) <pgsql-performance@postgresql.org>
Subject: Re: How to interpret this explain analyse?
Date: Fri, 11 Feb 2005 14:40:25 -0500
Message-ID: <13008.1108150825@sss.pgh.pa.us> (raw)
In-Reply-To: <A3D1526C98B7C1409A687E0943EAC410605F00@obelix.askesis.nl>
References: <A3D1526C98B7C1409A687E0943EAC410605F00@obelix.askesis.nl>

"Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl> writes:
> I cannot change the query (it is geneated by a tool called Clarion) but it something like (from the psqlodbc_xxx.log):
> "...
> declare SQL_CUR01 cursor for 
> SELECT A.ordernummer, B.klantnummer FROM "orders" A LEFT OUTER JOIN "klt_alg" B ON A.Klantnummer=B.Klantnummer ORDER BY A.klantnummer;
> fetch 100 in SQL_CUR01;
> ..."

Well, the planner does put some emphasis on startup time when dealing
with a DECLARE CURSOR plan; the problem you face is just that that
correction isn't large enough.  (From memory, I think it optimizes on
the assumption that 10% of the estimated rows will actually be fetched;
you evidently want a setting of 1% or even less.)

We once talked about setting up a GUC variable to control the percentage
of a cursor that is estimated to be fetched:
http://archives.postgresql.org/pgsql-hackers/2000-10/msg01108.php
It never got done but that seems like the most reasonable solution to
me.

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <13008.1108150825@sss.pgh.pa.us>
Permalink:  ../13008.1108150825@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13008.1108150825@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, J.Kraaijeveld@Askesis.nl, dev@archonet.com
  Subject: Re: How to interpret this explain analyse?
  In-Reply-To: <13008.1108150825@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox