title: QSqlQuery buffer size
body: <p>I have a large table in PostgresDB (55GB). I want to scan it in C++ with QT, summarize the result, and send it back to the DB. As far as I understand, by default QSqlQuery transfers all the data into the main memory. Is it possible to state explicit buffer size for the object? Is it also possible to tell to QT/Postgres that I would like to get the answer incrementally, i.e., not after all the data is comuted and only then sent to the C++ program?</p>
  
  <p>The code I am using is the following:</p>
  
  <pre><code>QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
  db.setHostName("server");
  db.setDatabaseName("db");
  db.setUserName("user");
  db.setPassword("pass");
  bool ok = db.open();
  
  QSqlQuery query;
  query.setForwardOnly(true);
  query.prepare("select attributes veryLargeTable");
  while (query.next()) {
      int i = query.value(0).toInt(); // and work with the data
  }
  </code></pre>
  
  <p>I saw an answer on the net recently, but I spent hours looking for the answer again without any success.</p>