Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c) - Mailing list pgsql-committers

From Hiroshi Inoue
Subject Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)
Date
Msg-id 39F8C7BD.6606A39D@tpf.co.jp
Whole thread Raw
In response to pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)  (Tom Lane <tgl@postgresql.org>)
Responses Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)
List pgsql-committers

Tom Lane wrote:

> Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> >> Re-implement LIMIT/OFFSET as a plan node type, instead of a hack in
> >> ExecutorRun.  This allows LIMIT to work in a view.  Also, LIMIT in a
> >> cursor declaration will behave in a reasonable fashion,
>
> > Does "reasonable" mean that LIMIT is treated as optimizer's
> > hint but doesn't restrict total FETCH counts ?
>
> No, it means that a LIMIT in a cursor means what it says: the cursor
> will show that many rows and no more.  FETCH lets you move around in
> the cursor, but not override the limit.  I decided that the other
> behavior was just too darn weird... if you want to argue about that,
> let's take it up on pghackers not committers.
>
> Yes, the optimizer does pay attention to the limit.
>

Hmm,I'm not sure about your point.
Please correct me if I'm misunderstanding.

We can specify rows count by FETCH command.
It seems to me that LIMIT in declare cursor statement is only
for optimizer's hint.

Regards.
Hiroshi Inoue



pgsql-committers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: pgsql/src/backend/utils/mb (conv.c)
Next
From: Hiroshi Inoue
Date:
Subject: Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)