Commit 02fbe60c authored by joreland@mysql.com's avatar joreland@mysql.com

Added testReadPerf that compares different access methods

- pk read (batch and serial)
- unique index read (batch and serial)
- eq-bound ordered index
- range ordered index
- sorted range ordered index
- interpretered scan
parent 040fcb2d
......@@ -30,7 +30,7 @@ testSystemRestart \
testTimeout \
testTransactions \
testDeadlock \
test_event ndbapi_slow_select
test_event ndbapi_slow_select testReadPerf
#flexTimedAsynch
#testBlobs
......@@ -67,6 +67,7 @@ testTransactions_SOURCES = testTransactions.cpp
testDeadlock_SOURCES = testDeadlock.cpp
test_event_SOURCES = test_event.cpp
ndbapi_slow_select_SOURCES = slow_select.cpp
testReadPerf_SOURCES = testReadPerf.cpp
INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
......
This diff is collapsed.
......@@ -229,11 +229,7 @@ run_scan(){
}
NdbScanOperation * pOp;
#ifdef NdbIndexScanOperation_H
NdbIndexScanOperation * pIOp;
#else
NdbScanOperation * pIOp;
#endif
NdbResultSet * rs;
int par = g_paramters[P_PARRA].value;
......@@ -241,13 +237,13 @@ run_scan(){
NdbScanOperation::LockMode lm;
switch(g_paramters[P_LOCK].value){
case 0:
lm = NdbScanOperation::LM_Read;
lm = NdbScanOperation::LM_CommittedRead;
break;
case 1:
lm = NdbScanOperation::LM_Exclusive;
lm = NdbScanOperation::LM_Read;
break;
case 2:
lm = NdbScanOperation::LM_CommittedRead;
lm = NdbScanOperation::LM_Exclusive;
break;
default:
abort();
......@@ -256,32 +252,16 @@ run_scan(){
if(g_paramters[P_ACCESS].value == 0){
pOp = pTrans->getNdbScanOperation(g_tablename);
assert(pOp);
#ifdef NdbIndexScanOperation_H
rs = pOp->readTuples(lm, bat, par);
#else
int oldp = (par == 0 ? 240 : par) * (bat == 0 ? 15 : bat);
rs = pOp->readTuples(oldp > 240 ? 240 : oldp, lm);
#endif
} else {
#ifdef NdbIndexScanOperation_H
pOp = pIOp = pTrans->getNdbIndexScanOperation(g_indexname, g_tablename);
bool ord = g_paramters[P_ACCESS].value == 2;
rs = pIOp->readTuples(lm, bat, par, ord);
#else
pOp = pIOp = pTrans->getNdbScanOperation(g_indexname, g_tablename);
assert(pOp);
int oldp = (par == 0 ? 240 : par) * (bat == 0 ? 15 : bat);
rs = pIOp->readTuples(oldp > 240 ? 240 : oldp, lm);
#endif
switch(g_paramters[P_BOUND].value){
case 0: // All
break;
case 1: // None
#ifdef NdbIndexScanOperation_H
pIOp->setBound((Uint32)0, NdbIndexScanOperation::BoundEQ, 0);
#else
pIOp->setBound((Uint32)0, NdbOperation::BoundEQ, 0);
#endif
break;
case 2: { // 1 row
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment