MATLAB DATABASE TOOLBOX RELEASE NOTES Guide de l'utilisateur Page 300

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 684
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 299
5 Using Visual Query Builder
5-22
Method 2 — Data Does Fit In MATLAB Variable But Not in JVM Heap
If your data (n) does fit in a MATLAB variable but not in a JVM heap, you need to find h
such that h < n.
To use automated batching to fetch where h rows fit in the JVM heap:
setdbprefs('FetchInBatches','yes')
setdbprefs('FetchBatchSize','h')
If using exec, fetch, and the connection object conn:
curs = exec(conn,'Select….');
curs = fetch(curs);
If using runsqlscript to run a query from an SQL file 'filename.sql':
results = runsqlscript(conn,'filename.sql')
Note that when you use automated batching and do not supply the rowLimit parameter
to fetch or the rowInc parameter to runsqlscript, a count query is executed
internally to get the total number of rows to be imported. This is done to preallocate the
output variable for better performance. In most cases, the count query overhead is not
much, but you can easily avoid it if you know or have a good idea of the value of n:
curs = fetch(curs,n)
or
results = runsqlscript(conn,'filename.sql’,'rowInc','n')
Method 3 — Data Fits in MATLAB Variable and JVM Heap
If your data (n) fits in a MATLAB variable and also in a JVM heap, then you need not
use batching at all.
setdbprefs('FetchInBatches','no')
If using fetch:
curs = fetch(curs);
If using runsqlscript to run a query from an SQL file 'filename.sql':
results = runsqlscript(conn,'filename.sql')
Vue de la page 299
1 2 ... 295 296 297 298 299 300 301 302 303 304 305 ... 683 684

Commentaires sur ces manuels

Pas de commentaire