> > Eberhard, Markus (external)  wrote:
> > I'm using SQLite in my application and I would like to fetch the
whole
> > result set of a select statement to memory.
> > I can't use sqlite3_get_table since it doesn't support BLOBs as far
> > as I know.
> > Currently I'm using function sqlite3_step to itterate through the
> > result set; that function calls winRead (->ReadFile) which consumes
> > between 60% and 70% of the application runtime (thousands of winRead
> > calls). That is why I'm searching for a possibility to fetch the
> > whole result set of a select statement to memory. Is there any
> > possibility to do that?
>
> Let me get this straight. The data is originally in a file on disk.
You 
> want it in memory. But you don't want the application to make any 
> ReadFile calls. How precisely do you expect the bits to get from here
to 
> there?
>
> sqlite3_get_table is implemented simply by looping with sqlite3_step -

> look at its source code. You can do the same, and save each row in
some 
> in-memory data structure. I don't see though how you expect any of
this 
> to reduce disk activity.
>
> Igor Tandetnik 

The thing I've thought about it is to read (using ReadFile or any other
function) the whole result set of a SELECT statement to memory. I think
it could be faster, especially if a result set consists of thousands of
rows (currently for each row the ReadFile function is called). In other
words: minimize the number of accesses to database file (but I'm not
sure if this is possible). 

Markus

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to