Re: [HACKERS] SELECT ... LIMIT (trial implementation) - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] SELECT ... LIMIT (trial implementation)
Date
Msg-id m0zUyPa-000EBPC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] SELECT ... LIMIT (trial implementation)  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-hackers
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) #

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] backslash in psql output
Next
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] SELECT ... LIMIT (trial implementation)