Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)
Date: 2000-10-28 16:35:29
Message-ID: 7794.972750929@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> Do you really think it's not such a good idea to have different optimizer
> behaviour for SELECT and DECLARE CURSOR? My expectation is that putting a
> SELECT statement inside a cursor should not change it's performance. I'd be
> interested to know the reasons for your choice.

I think it's an excellent idea to have different behaviors, and the
reason is that we know a stand-alone SELECT will deliver all its result
rows, whereas for DECLARE it's quite possible that not all the possible
result rows will be fetched. Moreover, the user is likely to fetch the
cursor's results in bite-size chunks, so he will be interested in
average response time as well as total time.

In the proposal as written, LIMIT ALL and LIMIT n will in fact give rise
to identical behavior in both contexts, and it's only the case without
an explicit LIMIT that will behave differently. (If we add a
SET-variable to control this, you could even make that behavior the same
too, by setting the variable to 1.0.)

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2000-10-28 18:27:55 pgsql/src/backend/port/beos (sem.c shm.c support.c)
Previous Message Vadim B. Mikheev - CVS 2000-10-28 16:21:02 pgsql/src/include/storage (buf_internals.h bufmgr.h bufpage.h smgr.h)

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2000-10-28 16:38:53 Re: Gram.y patches for better parenthesis handling.
Previous Message Tom Lane 2000-10-28 16:31:12 Re: Second proposal: what to do about INET/CIDR