--- [EMAIL PROTECTED] wrote:

> "Robert Simpson" <[EMAIL PROTECTED]> wrote:
> > 
> > By leaving it undocumented and not committing to today's implementation, DRH
> > leaves himself open to change or optimize it later without breaking backward
> > compatibility.
> > 
> 
> Exactly.
> 
> Furthermore, if you put on an ORDER BY clause that would result
> in the same ordering as would come out of the query naturally
> (that is to say if the result without the ORDER BY would have
> been the same as the result with the ORDER BY) then SQLite will 
> automatically optimize out the ORDER BY clause so there is no 
> performance penalty for using it.  So put in the ORDER BY.  It 
> will cost you nothing in performance today but might save you 
> from embarrassing bugs in your application if future enhancements
> to SQLite cause the natural order to be a little different.

Oracle surprised a few programmers when they changed their 
implementation of GROUP BY to not return the results in GROUP BY 
sorted order. They may have changed their GROUP BY to use a hash-based 
algorithm rather than basing it on a sort. In any event, such implicit
ORDER BY sorting when only using a GROUP BY was never guaranteed by 
the SQL standard. If you intend the results to be sorted, you must 
use ORDER BY.


 
____________________________________________________________________________________
Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to