Skip to content

Commit

Permalink
[oracle] Prefetch memory variable changed to 32-bit and default raise…
Browse files Browse the repository at this point in the history
…d to 8MB

Speeds up oracle table access by orders of magnitude

(cherry-pick from commit c3e7632)

Author :     Björn Harrtell <bjorn@wololo.org>
Date :       Mon Oct 29 21:27:46 2018 +0100
  • Loading branch information
bjornharrtell authored and rldhont committed Oct 31, 2018
1 parent cbd7ade commit 8a8a741
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/providers/oracle/ocispatial/qsql_ocispatial.cpp
Expand Up @@ -86,8 +86,8 @@
#include <stdlib.h>

#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.
// warning - this is not fully tested and can lead to race conditions
Expand Down Expand Up @@ -355,7 +355,7 @@ struct QOCISpatialResultPrivate
QList<QOCISDOGeometryInd*> sdoind;
bool transaction;
int serverVersion;
int prefetchRows, prefetchMem;
ub4 prefetchRows, prefetchMem;
OCIType *geometryTDO;
QOCISDOGeometryObj *geometryObj;
QOCISDOGeometryInd *geometryInd;
Expand Down Expand Up @@ -765,7 +765,7 @@ struct QOCISpatialDriverPrivate
bool transaction;
int serverVersion;
ub4 prefetchRows;
ub2 prefetchMem;
ub4 prefetchMem;
QString user;

OCIType *geometryTDO;
Expand All @@ -782,7 +782,7 @@ QOCISpatialDriverPrivate::QOCISpatialDriverPrivate()
, err( 0 )
, transaction( false )
, serverVersion( -1 )
, prefetchRows( 0xffffffff )
, prefetchRows( QOCISPATIAL_PREFETCH_ROWS )
, prefetchMem( QOCISPATIAL_PREFETCH_MEM )
, geometryTDO( 0 )
{
Expand Down Expand Up @@ -3381,13 +3381,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
{
Expand Down

0 comments on commit 8a8a741

Please sign in to comment.