tags:

views:

561

answers:

1

Hi ,

I want to know what is the performance difference between sqlite3_exec() and sqlite3_get_table().

is there a performance difference...?

+1  A: 

As with any performance issue, measure your specific use case.

The documentation for sqlite3_get_table tells the following:

This next routine is really just a wrapper around sqlite3_exec(). Instead of invoking a user-supplied callback for each row of the result, this routine remembers each row of the result in memory obtained from malloc(), then returns all of the result after the query has finished.

So one could presume that sqlite3_get_table performs worse, unless the processing to be done with sqlite3_exec directly is similar. How much they actually differ and whether the difference is significant is up to measurements on your data and your code.

laalto