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 \ ...@@ -30,7 +30,7 @@ testSystemRestart \
testTimeout \ testTimeout \
testTransactions \ testTransactions \
testDeadlock \ testDeadlock \
test_event ndbapi_slow_select test_event ndbapi_slow_select testReadPerf
#flexTimedAsynch #flexTimedAsynch
#testBlobs #testBlobs
...@@ -67,6 +67,7 @@ testTransactions_SOURCES = testTransactions.cpp ...@@ -67,6 +67,7 @@ testTransactions_SOURCES = testTransactions.cpp
testDeadlock_SOURCES = testDeadlock.cpp testDeadlock_SOURCES = testDeadlock.cpp
test_event_SOURCES = test_event.cpp test_event_SOURCES = test_event.cpp
ndbapi_slow_select_SOURCES = slow_select.cpp ndbapi_slow_select_SOURCES = slow_select.cpp
testReadPerf_SOURCES = testReadPerf.cpp
INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
......
This diff is collapsed.
...@@ -229,11 +229,7 @@ run_scan(){ ...@@ -229,11 +229,7 @@ run_scan(){
} }
NdbScanOperation * pOp; NdbScanOperation * pOp;
#ifdef NdbIndexScanOperation_H
NdbIndexScanOperation * pIOp; NdbIndexScanOperation * pIOp;
#else
NdbScanOperation * pIOp;
#endif
NdbResultSet * rs; NdbResultSet * rs;
int par = g_paramters[P_PARRA].value; int par = g_paramters[P_PARRA].value;
...@@ -241,13 +237,13 @@ run_scan(){ ...@@ -241,13 +237,13 @@ run_scan(){
NdbScanOperation::LockMode lm; NdbScanOperation::LockMode lm;
switch(g_paramters[P_LOCK].value){ switch(g_paramters[P_LOCK].value){
case 0: case 0:
lm = NdbScanOperation::LM_Read; lm = NdbScanOperation::LM_CommittedRead;
break; break;
case 1: case 1:
lm = NdbScanOperation::LM_Exclusive; lm = NdbScanOperation::LM_Read;
break; break;
case 2: case 2:
lm = NdbScanOperation::LM_CommittedRead; lm = NdbScanOperation::LM_Exclusive;
break; break;
default: default:
abort(); abort();
...@@ -256,32 +252,16 @@ run_scan(){ ...@@ -256,32 +252,16 @@ run_scan(){
if(g_paramters[P_ACCESS].value == 0){ if(g_paramters[P_ACCESS].value == 0){
pOp = pTrans->getNdbScanOperation(g_tablename); pOp = pTrans->getNdbScanOperation(g_tablename);
assert(pOp); assert(pOp);
#ifdef NdbIndexScanOperation_H
rs = pOp->readTuples(lm, bat, par); 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 { } else {
#ifdef NdbIndexScanOperation_H
pOp = pIOp = pTrans->getNdbIndexScanOperation(g_indexname, g_tablename); pOp = pIOp = pTrans->getNdbIndexScanOperation(g_indexname, g_tablename);
bool ord = g_paramters[P_ACCESS].value == 2; bool ord = g_paramters[P_ACCESS].value == 2;
rs = pIOp->readTuples(lm, bat, par, ord); 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){ switch(g_paramters[P_BOUND].value){
case 0: // All case 0: // All
break; break;
case 1: // None case 1: // None
#ifdef NdbIndexScanOperation_H
pIOp->setBound((Uint32)0, NdbIndexScanOperation::BoundEQ, 0); pIOp->setBound((Uint32)0, NdbIndexScanOperation::BoundEQ, 0);
#else
pIOp->setBound((Uint32)0, NdbOperation::BoundEQ, 0);
#endif
break; break;
case 2: { // 1 row case 2: { // 1 row
default: 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