Re: [sqlite] Re: SQLite Order BY

2006-10-09 Thread Arjen Markus

A. Pagaltzis wrote:


* John Stanton <[EMAIL PROTECTED]> [2006-10-09 19:35]:
 


Sorting data is time consuming, a physical law is involved. At
best it is an nlog(n) process.
   



Only when you sort by comparing elements with each other. Bucket
sort runs in O(n), f.ex. And quantum sort is O(1). ;-) Algorithms
that run faster than O(n log n) are very rarely practical,
however.
 


No, quantum sort is O(sqrt(n)) - much better than classical algorithms
but tough to implement and certainly not O(1) :)

Regards,

Arjen


Re: [sqlite] Re: SQLite Order BY

2006-10-09 Thread John Stanton

A. Pagaltzis wrote:

* John Stanton <[EMAIL PROTECTED]> [2006-10-09 19:35]:


Sorting data is time consuming, a physical law is involved. At
best it is an nlog(n) process.



Only when you sort by comparing elements with each other. Bucket
sort runs in O(n), f.ex. And quantum sort is O(1). ;-) Algorithms
that run faster than O(n log n) are very rarely practical,
however.

Regards,
Congratulations, you have your next project, modifying Sqlite to use a 
sort performing better than nlog(n).  We look forward to it and wish you 
well.


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



[sqlite] Re: SQLite Order BY

2006-10-09 Thread A. Pagaltzis
* John Stanton <[EMAIL PROTECTED]> [2006-10-09 19:35]:
> Sorting data is time consuming, a physical law is involved. At
> best it is an nlog(n) process.

Only when you sort by comparing elements with each other. Bucket
sort runs in O(n), f.ex. And quantum sort is O(1). ;-) Algorithms
that run faster than O(n log n) are very rarely practical,
however.

Regards,
-- 
Aristotle Pagaltzis // 

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



[sqlite] Re: SQLite Order BY

2006-10-09 Thread Igor Tandetnik

He Shiming <[EMAIL PROTECTED]> wrote:

select * from hvh5m,itm where hvh5m.Column4=itm.Icol1 order by
Column8


You can try creating two additional indexes, one on hvh5m.Column4 and
the other on hvh5m.Column8. They should speed things up.


Actually, what would help here is a compound index on (Column4, Column8)

Igor Tandetnik 



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