On Thu, 2005-03-24 at 13:59 -0500, Thomas Briggs wrote:
>    I feel like I'm missing something, but that didn't seem to help.  I
> can see in the code why it should be behaving differently (many thanks
> for the hint on where to look, BTW), but the memory usage is unchanged.
> 
>    I modified sqliteInt.h to define SQLITE_OMIT_MEMORYDB, then verified
> that it is defined by:
>    a) inserting garbage into vdbeaux.c to prevent it from compiling when
> SQLITE_OMIT_MEMORYDB is defined
>    b) tried to attach to database :memory: without success (it created a
> file name :memory: instead), and
>    c) started the command line tool without specifying a database and
> noting that the main database is a file named $CD/:memory: 
> 
>    Am I missing something stupid here?  Or is all my memory being used
> somewhere other than constructing the b-tree used for aggregation?
> 

It might be the case that SQLite is using memory in ways that
are extravagent, wasteful, and unnecessary.  Or you could be doing
something wrong in your app.  Hard to say.

Another big users of memory is ORDER BY.  If the ORDER BY clause
cannot be satisfied by use of an index, then the entire result
set is pulled into memory and sorted there.  Unlike the aggregate
issue, there is no easy fix for getting ORDER BY to work off of
disk, except appropriate use of indices in your schema.
-- 
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to