Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)
Date: 2000-10-27 04:34:18
Message-ID: 28051.972621258@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> writes:
> Tom Lane wrote:
>> Yes, but why should the presence of "limit all" affect that?
>> It's not apparent to me why the optimizer should treat this
>> case differently from plain
>> declare myc cursor for select * from t1;

> Am I misunderstanding ?
> Doesn't optimizer make the plan for the query
> "select * for t1" which would use SeqScan
> in most cases ?

In a plain SELECT, yes.  In a DECLARE CURSOR, it's currently set up
to prefer indexscans anyway, LIMIT or no LIMIT (see lines 853 ff in
src/backend/optimizer/plan/planner.c, current sources).  I think it
makes sense to have that preference for DECLARE, and what I'm wondering
is if we need an additional preference when the DECLARE contains a LIMIT
clause --- and if so, what should that be?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-10-27 04:55:17
Subject: Re: 7.0 vs. 7.1 (was: latest version?)
Previous:From: Hiroshi InoueDate: 2000-10-27 04:31:20
Subject: Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)

pgsql-committers by date

Next:From: Hiroshi InoueDate: 2000-10-27 05:06:42
Subject: Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)
Previous:From: Hiroshi InoueDate: 2000-10-27 04:31:20
Subject: Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group