Re: [HACKERS] weird behaviour on DISTINCT ON

2005-02-02 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: | Gaetano Mendola <[EMAIL PROTECTED]> writes: | |>my warning was due the fact that in the docs is written nowhere this |>drawback. | | | The SELECT reference page already says that the output rows are computed | before applying ORDER BY

Re: [HACKERS] weird behaviour on DISTINCT ON

2005-01-31 Thread Tom Lane
Gaetano Mendola <[EMAIL PROTECTED]> writes: > my warning was due the fact that in the docs is written nowhere this > drawback. The SELECT reference page already says that the output rows are computed before applying ORDER BY or DISTINCT. regards, tom lane

Re: [HACKERS] weird behaviour on DISTINCT ON

2005-01-31 Thread Gaetano Mendola
Greg Stark wrote: Gaetano Mendola <[EMAIL PROTECTED]> writes: now what do I see is that for each different x value the foo is executed more than once, I guess this is because the distinct filter out the rows after executing the query. Is this behaviour the normal one? Shall be not documented ? Us

Re: [HACKERS] weird behaviour on DISTINCT ON

2005-01-31 Thread Greg Stark
Gaetano Mendola <[EMAIL PROTECTED]> writes: > now what do I see is that for each different x value > the foo is executed more than once, I guess this is because > the distinct filter out the rows after executing the query. > > Is this behaviour the normal one? Shall be not documented ? Usually

[HACKERS] weird behaviour on DISTINCT ON

2005-01-31 Thread Gaetano Mendola
Hi all, I have a query that is something like this: SELECT DISTINCT ON ( x ) x, foo(x) FROM ... now what do I see is that for each different x value the foo is executed more than once, I guess this is because the distinct filter out the rows after executing the query. Is this behaviour the normal o