Here we go,

    this is up to now only for discussion, do not apply to CVS!

    Those involved into the LIMIT discussion please comment.

    Here is what I had in mind for the SELECT ... LIMIT.  It adds

        SELECT ... [LIMIT count [, offset]]

    to the parser and arranges that these values are passed  down
    to the executor.

    It is a clean implementation of LIMIT (regression tested) and
    the open items on it are to enable parameters and  handle  it
    in  SQL  functions and SPI stuff (currently ignored in both).
    Optimizing the executor would require  the  other  sort  node
    stuff  discussion  first to come to a conclusion.  For now it
    skips final result rows - but that's already one step forward
    since  it  reduces  the  rows sent to the frontend to exactly
    that what LIMIT requested.

    I've seen the queryLimit  by  SET  variable  stuff  and  that
    really  can  break rewrite rules, triggers or functions. This
    is because the query limit will be  inherited  by  any  query
    (inserts, updates, deletes too) done by them. Have a rule for
    constraint deletes of referencing tuples

        CREATE RULE del_table1 AS ON DELETE TO table1 DO
            DELETE FROM table2 WHERE ref = OLD.key;

    If the user now sets the query limit to 1 via SET and deletes
    a row from table1, only the first found record in table2 will
    be constraint deleted, not all of them.

    This is a feature where  users  can  get  around  rules  that
    ensure data integrity.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #


begin 644 opt_limit.diff.gz
M'XL(`$]=)S8"`^4\:W?B1K*?R:_H82=98&1;$F^<>`^+F1DV&!S`N<DGCBP:
M6SM"(I*PQSOQ?[]5_9!:(`$S<1Y[+V<&I.[JZJ[NZGIUM1?.<DE.[("$@7WJ
M!\[=V:UE?Z#>XLSV5RO+6X3RX=1&F#W57U4JE6/0%-X&#AG;$3$:Q#`Z]6JG
MVB)&N]WZZN3DY$`?J;9FI][HU&J\;27]88.IMC6H9J^(&E_K!)Y.OB+D;XYG
MNYL%)<5-Y+CAV<K^&)W>%S-JUGX066YV7?@4VI9]3['VC5(;1H'CW?$V\.^L
MPKI5/U!**H7"-4/>_TCM3>0'[ZFUOJ(K/W@B8;19+C.I,G1#,_1&0I>AFU#0
MDI05'"\J%`I+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_A;<T>#IG*<&6X2_LHNFC+*R0/./
J5".V8K`1>&?LC3PZT;V_B8@X[<#CAC]SA9Y)<AHC_9+_!=<!%F+O2@``
`
end

Fri, 16 Oct 1998 17:35:39 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
SELECT ... LIMIT (trial implementation)
I said:

>     It is a clean implementation of LIMIT (regression tested) and
>     the open items on it are to enable parameters and  handle  it
>     in  SQL  functions and SPI stuff (currently ignored in both).
>     Optimizing the executor would require  the  other  sort  node
>     stuff  discussion  first to come to a conclusion.  For now it
>     skips final result rows - but that's already one step forward
>     since  it  reduces  the  rows sent to the frontend to exactly
>     that what LIMIT requested.

    Parameters - done

    SPI stuff - done

    SQL functions - no LIMIT (cannot work)

    For  SPI  calls,  a  LIMIT  clause  in  the  query  will take
    precedence     over     the      tcount      argument      to
    SPI_exec()/SPI_execp().  So  SPI functions stay 100% backward
    compatible,  but  LIMIT  is  also  available  for  C  and  PL
    functions.

    Unfortunately  code  is frozen. And since this is feature, it
    is past 6.4. Or can we get it out of the refrigerator  for  a
    moment, Marc?


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #



Fri, 16 Oct 1998 20:36:08 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
jwieck@debis.com (Jan Wieck) writes:
>     I've seen the queryLimit  by  SET  variable  stuff  and  that
>     really  can  break rewrite rules, triggers or functions. This
>     is because the query limit will be  inherited  by  any  query
>     (inserts, updates, deletes too) done by them.
>     [ example snipped ]
>     This is a feature where  users  can  get  around  rules  that
>     ensure data integrity.

Ouch.  I think this point is a *fatal* objection to implementing
query limit as a SET variable.  That might be a quick-and-dirty way
of getting some functionality going, but we can't let it loose on the
world like that.

			regards, tom lane

Sat, 17 Oct 1998 13:21:54 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] SELECT ... LIMIT (trial implementation) 
> jwieck@debis.com (Jan Wieck) writes:
> >     I've seen the queryLimit  by  SET  variable  stuff  and  that
> >     really  can  break rewrite rules, triggers or functions. This
> >     is because the query limit will be  inherited  by  any  query
> >     (inserts, updates, deletes too) done by them.
> >     [ example snipped ]
> >     This is a feature where  users  can  get  around  rules  that
> >     ensure data integrity.
> 
> Ouch.  I think this point is a *fatal* objection to implementing
> query limit as a SET variable.  That might be a quick-and-dirty way
> of getting some functionality going, but we can't let it loose on the
> world like that.

OK, I assume you are saying that you like LIMIT/OFFSET in the query, but
not as a SET command that could be unreliable.

Jan has already coded a much more reliable, user-friently way, by
putting the LIMIT/OFFSET in the query, and I think that is the way to
go too.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 17 Oct 1998 23:47:35 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
> Here we go,
> 
>     this is up to now only for discussion, do not apply to CVS!
> 
>     Those involved into the LIMIT discussion please comment.
> 
>     Here is what I had in mind for the SELECT ... LIMIT.  It adds
> 
>         SELECT ... [LIMIT count [, offset]]
> 
>     to the parser and arranges that these values are passed  down
>     to the executor.

My only suggestion is that I don't like syntax where you have value
'a,b', and a and b have different meanings.

I would prefer:

         SELECT ... [LIMIT count [OFFSET offset]]

This makes things much clearer for people reading the query.

What if someone wants the rows from 500 to the end.  Should we allow
the syntax to be:

         SELECT ... [LIMIT count] [OFFSET offset]

LIMIT and OFFSET are independent.

>     It is a clean implementation of LIMIT (regression tested) and
>     the open items on it are to enable parameters and  handle  it
>     in  SQL  functions and SPI stuff (currently ignored in both).
>     Optimizing the executor would require  the  other  sort  node
>     stuff  discussion  first to come to a conclusion.  For now it
>     skips final result rows - but that's already one step forward
>     since  it  reduces  the  rows sent to the frontend to exactly
>     that what LIMIT requested.
> 
>     I've seen the queryLimit  by  SET  variable  stuff  and  that
>     really  can  break rewrite rules, triggers or functions. This
>     is because the query limit will be  inherited  by  any  query
>     (inserts, updates, deletes too) done by them. Have a rule for
>     constraint deletes of referencing tuples
> 
>         CREATE RULE del_table1 AS ON DELETE TO table1 DO
>             DELETE FROM table2 WHERE ref = OLD.key;
> 
>     If the user now sets the query limit to 1 via SET and deletes
>     a row from table1, only the first found record in table2 will
>     be constraint deleted, not all of them.
> 
>     This is a feature where  users  can  get  around  rules  that
>     ensure data integrity.


OK, I am all for removal of SET QUERY_LIMIT, especially if we think we
can get something better in a post-6.4 release.

I assume the current strategy for impelemting LIMIT..OFFSET is:

	For single-table queries, if the index matches the ORDER BY, use
the index to do the LIMIT..OFFSET.  Large offset value require a
sequential scan of the index until it reaches the OFFSET.

	For joins, if an index matches the ORDER BY, and the indexed
table is on the outside of a join loop, use the index to force the query
to execute in ORDER BY order, and reduce the number of values in the
query.

It would be nifty if we could peek into the index and change LIMIT to an
actual range of value that would automatically match an index, then you
have to force the optimizer to use the index,  i.e.


	SELECT * FROM tab LIMIT 100

becomes:

	SELECT * FROM tab WHERE x < 732

but that is very strange to do, and I would prefer not to approach it
that way.  Seems like Jan has already done it better than that.


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sun, 18 Oct 1998 00:42:32 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
Hi all,
currently CVS is not working. It gives the following error message:

marliesle:/usr/local/pgsql# cvs -z3 update -d
Fatal error, aborting.
: no such user

-Egon


Sun, 18 Oct 1998 07:45:15 +0200 (MET DST)
Egon Schmid <eschmid@delos.stuttgart.netsurf.de>
CVS not working
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> OK, I assume you are saying that you like LIMIT/OFFSET in the query, but
> not as a SET command that could be unreliable.

Precisely.  Adding LIMIT/OFFSET options to SELECT sounds like a good idea
for all the reasons previously given.  But the SET QUERYLIMIT command
is positively dangerous --- I think we should take it out.

			regards, tom lane

Sun, 18 Oct 1998 12:01:53 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] SELECT ... LIMIT (trial implementation) 
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> What if someone wants the rows from 500 to the end.  Should we allow
> the syntax to be:
>          SELECT ... [LIMIT count] [OFFSET offset]
> LIMIT and OFFSET are independent.

I like that syntax the best, but remember we are not inventing in
a green field here.  Isn't this a feature that already exists in
other DBMs?  We should probably copy their syntax, unless it's
truly spectacularly awful...

			regards, tom lane

Sun, 18 Oct 1998 12:04:49 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] SELECT ... LIMIT (trial implementation) 
On Sun, 18 Oct 1998, Tom Lane wrote:

> Date: Sun, 18 Oct 1998 12:04:49 -0400
> From: Tom Lane <tgl@sss.pgh.pa.us>
> To: Bruce Momjian <maillist@candle.pha.pa.us>
> Cc: pgsql-hackers@postgreSQL.org
> Subject: Re: [HACKERS] SELECT ... LIMIT (trial implementation) 
> 
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > What if someone wants the rows from 500 to the end.  Should we allow
> > the syntax to be:
> >          SELECT ... [LIMIT count] [OFFSET offset]
> > LIMIT and OFFSET are independent.
> 
> I like that syntax the best, but remember we are not inventing in
> a green field here.  Isn't this a feature that already exists in
> other DBMs?  We should probably copy their syntax, unless it's
> truly spectacularly awful...
> 
> 			regards, tom lane
> 

Mysql uses LIMIT [offset,] rows 
>From documentation:

      LIMIT takes one or two numeric arguments. A single argument
      represents the maximum number of rows to return in a result. If two
      arguments are given the first argument is the offset to the first row to
      return, while the second is the maximum number of rows to return in the
      result. 

What would be nice if somehow total number of rows could be returned.
This is often needed for altavista-like application.
Of course, I can do
select count(*) from sometable ... LIMIT offset, rows
and then
select ... from sometable ... LIMIT offset, rows
but this seems not elegant solution.

	Regards,

		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


Sun, 18 Oct 1998 21:45:24 +0400 (MSD)
Oleg Bartunov <oleg@sai.msu.su>
Re: [HACKERS] SELECT ... LIMIT (trial implementation) 
Jan,

I tested your patch on my Linux box and it works ok, except
aggregates functions doesn't work properly, for example
count(*) always produces 0

kdo=> select count(*)  from work_flats limit 10,1000;
count
-----
(0 rows)

while

kdo=> select rooms from work_flats limit 10,1000;
rooms
-----
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
(10 rows)


	Regards,

		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


Sun, 18 Oct 1998 21:58:41 +0400 (MSD)
Oleg Bartunov <oleg@sai.msu.su>
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
Oleg Bartunov wrote:

>
> Jan,
>
> I tested your patch on my Linux box and it works ok, except
> aggregates functions doesn't work properly, for example
> count(*) always produces 0

    They work absolutely properly :-)

>
> kdo=> select count(*)  from work_flats limit 10,1000;
> count
> -----
> (0 rows)

    As  I  wrote,  the  executor  skips final result rows. In the
    obove query, there is only one result row (the  one  returned
    by the aggregate function). You asked the executor to skip it
    and it did.

    We cannot limit selections in deeper levels than the top one.
    This would give unpredictable results in joins.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #



Sun, 18 Oct 1998 21:22:42 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
Oleg Bartunov wrote:

> On Sun, 18 Oct 1998, Tom Lane wrote:
>
> > Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > > What if someone wants the rows from 500 to the end.  Should we allow
> > > the syntax to be:
> > >          SELECT ... [LIMIT count] [OFFSET offset]
> > > LIMIT and OFFSET are independent.
> >
> > I like that syntax the best, but remember we are not inventing in
> > a green field here.  Isn't this a feature that already exists in
> > other DBMs?  We should probably copy their syntax, unless it's
> > truly spectacularly awful...
> >
> >            regards, tom lane
> >
>
> Mysql uses LIMIT [offset,] rows
> >From documentation:
>
>       LIMIT takes one or two numeric arguments. A single argument
>       represents the maximum number of rows to return in a result. If two
>       arguments are given the first argument is the offset to the first row to
>       return, while the second is the maximum number of rows to return in the
>       result.

    Simple change, just flip them in gram.y.

    And for the 500 to end:

        SELECT ... LIMIT 500, 0 (after flipped)

    The  0  has  the  same meaning as ALL. And that could also be
    added to the parser easily so one can say

        SELECT ... LIMIT 500, ALL

    too.

>
> What would be nice if somehow total number of rows could be returned.
> This is often needed for altavista-like application.
> Of course, I can do
> select count(*) from sometable ... LIMIT offset, rows
> and then
> select ... from sometable ... LIMIT offset, rows
> but this seems not elegant solution.

    Absolutely makes no sense  for  me.  As  said  in  the  other
    posting,  aggregates  do  the counting scan in a deeper level
    and thus cannot get limited. So if you invoke  an  aggregate,
    the whole scan is always done.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #



Sun, 18 Oct 1998 21:29:43 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
On Sun, 18 Oct 1998, Tom Lane wrote:

> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > What if someone wants the rows from 500 to the end.  Should we allow
> > the syntax to be:
> >          SELECT ... [LIMIT count] [OFFSET offset]
> > LIMIT and OFFSET are independent.
> 
> I like that syntax the best, but remember we are not inventing in
> a green field here.  Isn't this a feature that already exists in
> other DBMs?  We should probably copy their syntax, unless it's
> truly spectacularly awful...
> 
> 			regards, tom lane

None that I have used (VFP, M$ SQL Server) that had 'LIMIT', had 'OFFSET'.
So it would seem that the very idea of OFFSET is to break with what others
are doing.

I too like the above syntax. 
Why mimic, when you can do better?  Go for it!

Just my vote, have a great day
Terry Mackintosh <terry@terrym.com>          http://www.terrym.com
sysadmin/owner  Please! No MIME encoded or HTML mail, unless needed.

Proudly powered by R H Linux 4.2, Apache 1.3, PHP 3, PostgreSQL 6.3
-------------------------------------------------------------------
Success Is A Choice ... book by Rick Patino, get it, read it!


Sun, 18 Oct 1998 15:58:57 -0400 (EDT)
Terry Mackintosh <terry@terrym.com>
Re: [HACKERS] SELECT ... LIMIT (trial implementation) 
Hi folks,
Fatal error, aborting.
: no such user

-Egon



Sun, 18 Oct 1998 22:00:39 +0200 (MET DST)
Egon Schmid <eschmid@delos.stuttgart.netsurf.de>
CVS ...
>
> On Sun, 18 Oct 1998, Tom Lane wrote:
>
> > Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > > What if someone wants the rows from 500 to the end.  Should we allow
> > > the syntax to be:
> > >          SELECT ... [LIMIT count] [OFFSET offset]
> > > LIMIT and OFFSET are independent.
> >
> > I like that syntax the best, but remember we are not inventing in
> > a green field here.  Isn't this a feature that already exists in
> > other DBMs?  We should probably copy their syntax, unless it's
> > truly spectacularly awful...
> >
> >            regards, tom lane
>
> None that I have used (VFP, M$ SQL Server) that had 'LIMIT', had 'OFFSET'.
> So it would seem that the very idea of OFFSET is to break with what others
> are doing.
>
> I too like the above syntax.
> Why mimic, when you can do better?  Go for it!
>

    We have a powerful parser. So we can provide

        ... [ LIMIT { rows | ALL } ] [ OFFSET skip ]

        or

        ... [ LIMIT [ skip , ] { rows | ALL } ]

    at the same time.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #



Sun, 18 Oct 1998 22:05:31 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
Re: [HACKERS] SELECT ... LIMIT (trial implementation)
>     We have a powerful parser. So we can provide
> [...]

    This version now accepts all of the following

        ... [ LIMIT rows ] [ OFFSET skip ]
        ... [ OFFSET skip ] [ LIMIT rows ]
        ... [ LIMIT [ skip , ] rows ]

    rows  can be a positive integer constant greater that 0, a $n
    parameter (in SPI_prepare()) or  the  keyword  ALL.  0  isn't
    accepted  as  constant to force ALL in that case making clear
    that this is wanted. In the  parameter  version  the  integer
    value 0 still is used to mean ALL.

    skip can be a positive integer constant greater or equal to 0
    or a $n parameter for SPI_prepare.

    If any of these syntaxes is used  in  SPI_prepare()'d  plans,
    the  given tcount argument for SPI_execp() is ignored and the
    plan or parameter values are used.

    Anyone happy now?


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

begin 644 opt_limit.diff.gz
M'XL(")%0*C8"`V]P=%]L:6UI="YD:69F`.4\:W?;-K*?U5^!:-.NY-"V*-EZ
MN?$>5:83;67)U2-MSSWWZ-`29/-&(E62BN--_=_OS``@08F4E4>;[JY/&Y'`
M8(`9#&8&@P%GSGS.#J<^"_SID><[M\<W]O0M=V?'4V^YM-U9H!Z.I@BSH_J;
M@X.#?=#D+GV']:<A,ZO,-)NGE6:ESLQ&H_[-X>'A$WTDVI:;I]7FR8EH>Y#\
MH\%4&@94TRNBQM=3!D^'WS#V-\>=+M8SSO+KT%D$Q\OI^_#H+I]2L_+\T%ZD
MUP4/P=2>WG&L?:'5!J'ON+>B#?QW?$#=ZG]0R@YRN6M";KWGTW7H^:^YO;KB
M2\]_8$&XGL]3J3)+IF&6JC%=9JD,!75%6<YQPUPN-^=VN/;Y&9;\M.;^PP4/
MIM#G;^J9:D1O;<\-^?N03<7O&="2@[(`\"R<Y=1;N^&9H"273DH.:`ELUPD?
M&'!C^C9('[E9,4RSKHW</#7,RDDT\L<=G;R@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