[Cppcms-users] Avoid loading query results completely into cppdb::result
Brought to you by:
artyom-beilis
From: Alexander M. (EvalSys) <a....@ev...> - 2015-04-01 09:49:32
|
Dear Artyom, Dear community, I was wondering if it's possible, to avoid loading the complete query result into cppdb::result but handle the query results "step by step"? If I'm running the following query on a bigger database <code> cppdb::result <http://cppcms.com/sql/cppdb/classcppdb_1_1result.html> r = sql <<"SELECT name,age FROM students"; </code> it takes a lot of time to copy all the results into the cppdb::result container. For testing I tried that for about 6 mio entries.. I didn't work with the original MySQL-lib yet.. but if I send the query using the standard MySQL lib e.g. <code> | res= mysql_perform_query(conn, "SELECT * FROM students"); while ((row= mysql_fetch_row(res)) !=NULL) ....| </code> it seems that the interface delivers single rows only, if I'm fetching the result (row by row). Now I was wondering, if there is some technique / flag to do the same with cppdb? In the end I'm trying to run through a big amount of data. If I'm trying offset/limit combinations, it gets very slow as soon as offset increases.. It'd be great, if someone would have a tipp for me. Thank you very much, Alex |