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-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 29, 2018
1 parent cbd7ade commit 8a8a741ff24461b845ea51488224e8d4a5f6e587
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/providers/oracle/ocispatial/qsql_ocispatial.cpp
@@ -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
@@ -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;
@@ -765,7 +765,7 @@ struct QOCISpatialDriverPrivate
bool transaction;
int serverVersion;
ub4 prefetchRows;
ub2 prefetchMem;
ub4 prefetchMem;
QString user;

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

0 comments on commit 8a8a741

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