Dear list members,

I'm trying to extract the results of a query that returns fairly large amounts 
of data (100-200Mb) as quickly as possible using the c/c++ api.

Is there any way to avoid unnecessarily duplicating the data coming from the 
following functions?

 const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
 const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);

I need access to the results of these functions beyond subsequent calls to 
sqlite3_step().

Or is this duplication unavoidable?

The naive half of my brain wants my application to take responsibility for the 
memory that the text or blob occupies.

But I'm not optimistic this is either a) possible or b) worthwhile because the 
marginally less naive half of my brain presumes that the results of these calls 
are pointers to memory within some highly optimised caching/paging system that 
can't hand over responsibility for sub-chunks of memory willy-nilly, and were 
there even to be some way I could take ownership of the memory via the sqlite 
api, it would just shift responsibility for allocating new chunks of memory for 
further row results away from my code and into sqlite.c so the gain would be 
limited to avoiding an unnecessary copy step from sqlite's memory into mine. 
But even that's likely to give a worthwhile speed-up, if it's possible.
Many thanks,


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

Reply via email to