On Sat, Aug 20, 2005 at 06:36:19PM -0400, D. Richard Hipp wrote: > On Sun, 2005-08-21 at 03:21 +0530, Ligesh wrote: > > I am running a very simple sql query with only one instance. The > > query is something like: > > > > > > In order to implement the ORDER BY clause, SQLite reads the > entire result set into memory and sorts it there. When your > result set gets very large (13000 rows) and each row uses in > excess of 1KB or memory, this is apparently causing your > machine to thrash. > --
Thanks, so I would like to know if all sql databases do this. I am not a database expert per say, and that is one of the reasons why the row size is a bit large. Two of the columns are kept serialized, (they are unserialized only at the exact point when they are needed, so as such they don't introduce any overhead other than increasing the row size. Does sqlite 3 do it in the proper way. That is, just load the the sort column + a pointer-to-the-row to the ram. Sort it there, and return the result? Actually the database structure is a full hierarchical tree, and this is the ONLY query I execute. That is, just get the children of a particular parent. Thanks a lot. - Ligesh

