![]() | |
#21
| |||
| |||
|
|
On Tue, 01 Dec 2009 13:45:44 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: Gene Wirchenko <ge... (AT) ocis (DOT) net> writes: On Tue, 01 Dec 2009 08:50:34 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: joel garry <joel-ga... (AT) home (DOT) com> writes: [snip] Can't a function be part of the DBMS? A non-relational function shouldn't be part of a relational DBMS, no. This was far too broad, I now see. Originally it was in the context of a *query* returning a non-relational result, which is really as far as I should have taken it. * * *I think you still have problems with the division. *(I do not claim to be able to define the split myself. *I know how difficult it can be to rigourously define something.) |
|
* * *Addition of integral values is a function mapping two integral values to an integral value. Right; of course, there are heaps of functions operating on attribute values that can be used *within* relational operations to modify the relation that will be returned. Such functions definitely belong as part of the relational DBMS. 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. * * *Having to go through a sort stage when the DBMS might well have been able to easily handle it would be counterproductive. * * *For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. |
#22
| |||
| |||
|
|
On Nov 30, 8:35 pm, Gene Wirchenko <ge... (AT) ocis (DOT) net> wrote: On Tue, 01 Dec 2009 13:45:44 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: Gene Wirchenko <ge... (AT) ocis (DOT) net> writes: On Tue, 01 Dec 2009 08:50:34 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: joel garry <joel-ga... (AT) home (DOT) com> writes: [snip] Can't a function be part of the DBMS? A non-relational function shouldn't be part of a relational DBMS, no. This was far too broad, I now see. Originally it was in the context of a *query* returning a non-relational result, which is really as far as I should have taken it. I think you still have problems with the division. (I do not claim to be able to define the split myself. I know how difficult it can be to rigourously define something.) And perhaps relvars can torture non-relations to relations. But this is all too deep for me. I mostly agree with you guys. There should be clear delineations between relational and non-relational parts of systems, as well as standard SQL versus extensions and procedurals. Addition of integral values is a function mapping two integral values to an integral value. Right; of course, there are heaps of functions operating on attribute values that can be used *within* relational operations to modify the relation that will be returned. Such functions definitely belong as part of the relational DBMS. 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. |
|
Having to go through a sort stage when the DBMS might well have been able to easily handle it would be counterproductive. For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. This is certainly wrong in Oracle, and ought to be wrong everywhere else. I don't say that as an Oracle wonk, but rather because ordering needs to be explicit by definition. jg -- @home.com is bogus. http://codeoffsets.com/ |
#23
| |||
| |||
|
|
For example, a group by in SQL forces the result to be sorted by the grouping unless otherwise overridden. |
#24
| |||
| |||
|
|
joel garry schreef: On Nov 30, 8:35 pm, Gene Wirchenko <ge... (AT) ocis (DOT) net> wrote: On Tue, 01 Dec 2009 13:45:44 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: Gene Wirchenko <ge... (AT) ocis (DOT) net> writes: On Tue, 01 Dec 2009 08:50:34 +1100, Ben Finney bignose+hates-s... (AT) benfinney (DOT) id.au> wrote: joel garry <joel-ga... (AT) home (DOT) com> writes: [snip] Can't a function be part of the DBMS? A non-relational function shouldn't be part of a relational DBMS, no. This was far too broad, I now see. Originally it was in the context of a *query* returning a non-relational result, which is really as far as I should have taken it. * * *I think you still have problems with the division. *(I donot claim to be able to define the split myself. *I know how difficult it can be to rigourously define something.) And perhaps relvars can torture non-relations to relations. *But this is all too deep for me. *I mostly agree with you guys. *There should be clear delineations between relational and non-relational parts of systems, as well as standard SQL versus extensions and procedurals. * * *Addition of integral values is a function mapping two integral values to an integral value. Right; of course, there are heaps of functions operating on attribute values that can be used *within* relational operations to modify the relation that will be returned. Such functions definitely belong as part of the relational DBMS. What I was trying to express was that relational operations — like the various relational operations that ‘SELECT’ implements — shouldonly 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. I thought that one was about the order of attributes, not rows. |
#25
| |||
| |||
|
|
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. I thought that one was about the order of attributes, not rows. |
#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) |
#27
| |||
| |||
|
|
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 |
#28
| |||
| |||
|
|
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 |
#29
| |||
| |||
|
|
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.... |
#30
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |