![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
Granted that that would be implementation-dependent, but it would be convenient for it to do it that way while grouping. (How else would it?) At least Oracle and Postgres do some kind of hashing most of the time, which does not sort the results at all. |
|
It would be silly for the DBMS to sort internally and then the converter do it again. Agreed. But I think any modern optimizer will combine these steps if that would be quicker |
#22
| |||
| |||
|
|
Thomas Kellerer schreef: Gene Wirchenko wrote on 01.12.2009 05:35: For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. Never has been true. Group by does *not* sort the result. Not even in Oracle 8 and and certainly not for any Oracle version > 9 (and not for any Postgres as well) Thomas Never? It did at least in Oracle 7. As a well known and too many times used side effect. I remember having to reprogram queries because developed programs relied on the sort.... |
#23
| |||
| |||
|
|
Thomas Kellerer schreef: Gene Wirchenko wrote on 01.12.2009 05:35: * * *For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. Never has been true. Group by does *not* sort the result. Not even in Oracle 8 and and certainly not for any Oracle version > 9 (and not for any Postgres as well) Thomas Never? It did at least in Oracle 7. As a well known and too many times used side effect. I remember having to reprogram queries because developed programs relied on the sort.... Shakespeare |
#24
| |||
| |||
|
|
Thomas Kellerer schreef: Gene Wirchenko wrote on 01.12.2009 05:35: For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. Never has been true. Group by does *not* sort the result. Not even in Oracle 8 and and certainly not for any Oracle version > 9 (and not for any Postgres as well) Thomas Never? It did at least in Oracle 7. As a well known and too many times used side effect. I remember having to reprogram queries because developed programs relied on the sort.... Shakespeare |
#25
| |||
| |||
|
|
"Shakespeare" <whatsin (AT) xs4all (DOT) nl> a écrit dans le message de news: 4b1613a0$0$22919$e4fe514c (AT) news (DOT) xs4all.nl... | Thomas Kellerer schreef: | > Gene Wirchenko wrote on 01.12.2009 05:35: | >> For example, a group by in SQL forces the result to be sorted by | >> the grouping unless otherwise overridden. | | > Never has been true. Group by does *not* sort the result. Not even in | > Oracle 8 and and certainly not for any Oracle version > 9 (and not for | > any Postgres as well) | | > Thomas | | Never? It did at least in Oracle 7. As a well known and too many times | used side effect. I remember having to reprogram queries because | developed programs relied on the sort.... | | Shakespeare And you did it wrong, even in Oracle7. Grouping needs some sort but in an internal (binary) one which may not be a user sort (any country using a language with national characters has experimented this). Regards Michel |
#26
| |||
| |||
|
|
Gene Wirchenko wrote on 01.12.2009 05:35: * * *For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. Never has been true. Group by does *not* sort the result. Not even in Oracle 8 and and certainly not for any Oracle version > 9 (and not for any Postgres as well) Thomas |
#27
| |||
| |||
|
|
Gene Wirchenko <ge... (AT) ocis (DOT) net> writes: On Tue, 01 Dec 2009 13:45:44 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: What I was trying to express was that relational operations — like the various relational operations that ‘SELECT’ implements — should only return data as relations (they might also return status responses). They should never return non-relation data. * * *A relation does not have order. *This would not be a relation * * * * * select clicode,cliname from clients order by clicode because of the order by clause. Hmm. I'm not sure it's right to say the result would not *be* a relation; but I certainly take the point about ‘ORDER BY’ requesting order be imposed on an orderless relation. |
#28
| |||
| |||
|
|
On Nov 30, 8:52Â*pm, Ben Finney <bignose+hates-s... (AT) benfinney (DOT) id.au wrote: Hmm. I'm not sure it's right to say the result would not *be* a relation; but I certainly take the point about ‘ORDER BY’ requesting order be imposed on an orderless relation. Should anyone care, I ran across this while meditating upon Chris Date giving a seminar in Dallas next month: […] |
![]() |
| Thread Tools | |
| Display Modes | |
| |