I don't known better way but can suggest to try this code with simple optimization:
QSqlQuery query
("SELECT Id, Name, Address FROM user20");
while(query.next())
{
data+=query.value(0).toByteArray();
data+=unit_sp;
data+=query.value(1).toByteArray();
data+=unit_sp;
data+=query.value(2).toByteArray();
data+=record_sp;
}
QSqlQuery query("SELECT Id, Name, Address FROM user20");
while(query.next())
{
data+=query.value(0).toByteArray();
data+=unit_sp;
data+=query.value(1).toByteArray();
data+=unit_sp;
data+=query.value(2).toByteArray();
data+=record_sp;
}
To copy to clipboard, switch view to plain text mode
Plz try it. It very interestingly for me how long it will be take
And you can extract data in parts (for example every 1000 records). It help for minimization memory usage.
Bookmarks