Skip to content
Permalink
Browse files

[oracle] Prefetch memory variable changed to 32-bit and default raise…

…d to 8MB

Speeds up oracle table access by orders of magnitude

(cherry picked from commit c3e7632)
  • Loading branch information
bjornharrtell authored and nyalldawson committed Oct 29, 2018
1 parent fe8875c commit ac1fa9e6b1c8f74c96470823b5d79078c0f155c5
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/providers/oracle/ocispatial/qsql_ocispatial.cpp
@@ -99,7 +99,8 @@
#include <cstdlib>

#define QOCISPATIAL_DYNAMIC_CHUNK_SIZE 65535
#define QOCISPATIAL_PREFETCH_MEM 10240
#define QOCISPATIAL_PREFETCH_ROWS 10000
#define QOCISPATIAL_PREFETCH_MEM 8388608 // 8MB

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

OCIType *geometryTDO = nullptr;
@@ -429,7 +430,7 @@ class QOCISpatialResultPrivate: public QSqlCachedResultPrivate
QList<QOCISDOGeometryInd *> sdoind;
bool transaction;
int serverVersion;
int prefetchRows, prefetchMem;
ub4 prefetchRows, prefetchMem;
OCIType *geometryTDO = nullptr;
QOCISDOGeometryObj *geometryObj = nullptr;
QOCISDOGeometryInd *geometryInd = nullptr;
@@ -3833,13 +3834,13 @@ static void qParseOpts( const QString &options, QOCISpatialDriverPrivate *d )
{
d->prefetchRows = val.toInt( &ok );
if ( !ok )
d->prefetchRows = 0xffffffff;
d->prefetchRows = QOCISPATIAL_PREFETCH_ROWS;
}
else if ( opt == QLatin1String( "OCI_ATTR_PREFETCH_MEMORY" ) )
{
d->prefetchMem = val.toInt( &ok );
if ( !ok )
d->prefetchMem = 0xffff;
d->prefetchMem = QOCISPATIAL_PREFETCH_MEM;
}
else
{

0 comments on commit ac1fa9e

Please sign in to comment.
You can’t perform that action at this time.