Skip to content

Commit c3e7632

Browse files
bjornharrtelljef-n
authored andcommitted
Prefetch memory variable changed to 32-bit and default raised to 8MB
1 parent 0d7f598 commit c3e7632

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/providers/oracle/ocispatial/qsql_ocispatial.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
#include <cstdlib>
100100

101101
#define QOCISPATIAL_DYNAMIC_CHUNK_SIZE 65535
102-
#define QOCISPATIAL_PREFETCH_MEM 10240
102+
#define QOCISPATIAL_PREFETCH_ROWS 10000
103+
#define QOCISPATIAL_PREFETCH_MEM 8388608 // 8MB
103104

104105
// setting this define will allow using a query from a different
105106
// thread than its database connection.
@@ -341,8 +342,8 @@ class QOCISpatialDriverPrivate : public QSqlDriverPrivate
341342
OCIError *err = nullptr;
342343
bool transaction = false;
343344
int serverVersion = -1;
344-
ub4 prefetchRows = 0xffffffff;
345-
ub2 prefetchMem = QOCISPATIAL_PREFETCH_MEM;
345+
ub4 prefetchRows = QOCISPATIAL_PREFETCH_ROWS;
346+
ub4 prefetchMem = QOCISPATIAL_PREFETCH_MEM;
346347
QString user;
347348

348349
OCIType *geometryTDO = nullptr;
@@ -429,7 +430,7 @@ class QOCISpatialResultPrivate: public QSqlCachedResultPrivate
429430
QList<QOCISDOGeometryInd *> sdoind;
430431
bool transaction;
431432
int serverVersion;
432-
int prefetchRows, prefetchMem;
433+
ub4 prefetchRows, prefetchMem;
433434
OCIType *geometryTDO = nullptr;
434435
QOCISDOGeometryObj *geometryObj = nullptr;
435436
QOCISDOGeometryInd *geometryInd = nullptr;
@@ -3833,13 +3834,13 @@ static void qParseOpts( const QString &options, QOCISpatialDriverPrivate *d )
38333834
{
38343835
d->prefetchRows = val.toInt( &ok );
38353836
if ( !ok )
3836-
d->prefetchRows = 0xffffffff;
3837+
d->prefetchRows = QOCISPATIAL_PREFETCH_ROWS;
38373838
}
38383839
else if ( opt == QLatin1String( "OCI_ATTR_PREFETCH_MEMORY" ) )
38393840
{
38403841
d->prefetchMem = val.toInt( &ok );
38413842
if ( !ok )
3842-
d->prefetchMem = 0xffff;
3843+
d->prefetchMem = QOCISPATIAL_PREFETCH_MEM;
38433844
}
38443845
else
38453846
{

0 commit comments

Comments
 (0)