On 30/10/12 5:25 PM, Xiaognag Wang wrote:
You mean this big difference (7 seconds and 30 millisecond ) was
caused by cache?
Oh yes. There's a big difference between having 1 chunk of data sent
from the server to the client and having the client poll the server
every time your app says fetchNext(); The effect becomes even more
pronounced as you increase the latency between your app and the database
server (eg. if it's on a network instead of on the local machine).
In my testing, query.next() just retured 256 records.
and I can not find methods to set cache enable in qt, should I set
cache at oracle side?
If you're using oracle, you want to look at OCI_ATTR_PREFETCH_ROWS
and/or OCI_ATTR_PREFETCH_MEMORY. See QSqlDatabase::setConnectOptions().
--
Link
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest