Zbigniew Baniewski <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 18, 2007 at 02:10:02PM -0600, John Stanton wrote:
> 
> > It won't be ignored.  If you have an index ordered in the sequence 
> > specified by the ORDER BY Sqlite will use that order instead of having 
> > to assemble the result set and sort it.
> 
> To say it precisely: although it won't be ignored - but (in the case
> mentioned above) it won't be used anyway, and won't spoil the speed gain,
> given by index, right?
> 
> I'm asking, because tries with new database I prefer to make without
> indexing, and add indexes later. So I was wondering, should I then check the
> code again, to remove some "ORDER BY"-s, or can I skip it.

Always include the ORDER BY.  SQLite will automatically omit the
sorting step if it decides to run the query using an index that
outputs the result in sorted order.

--
D. Richard Hipp <[EMAIL PROTECTED]>


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

Reply via email to