Loading ndb/docs/wl2077.txt 0 → 100644 +35 −0 Original line number Diff line number Diff line 100' * (select 1 from T1 (1M rows) where key = rand()); 1 host, 1 ndbd, api co-hosted results in 1000 rows / sec wo/reset bounds w/ rb 4.1-read committed a) 4.9 b) 7.4 4.1-read hold lock c) 4.7 d) 6.7 wl2077-read committed 6.4 (+30%) 10.8 (+45%) wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) -- Comparision e) serial pk: 10.9' batched (1000): 59' serial uniq index: 8.4' batched (1000): 33' index range (1000): 186' ---- load) testScanPerf -c 1 -d 1 T1 a) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 0 T1 b) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 1 T1 c) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 0 T1 d) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 1 T1 e) testReadPerf -i 25 -c 0 -d 0 T1 --- music join 1db-co 2db-co 4.1 13s 14s 4.1 wo/ blobs 1.7s 3.2s wl2077 12s 14s wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%) ndb/src/kernel/blocks/dbdih/Dbdih.hpp +0 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,6 @@ public: Uint32 nfConnect; Uint32 table; Uint32 userpointer; Uint32 nodeCount; BlockReference userblockref; }; typedef Ptr<ConnectRecord> ConnectRecordPtr; Loading ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +9 −11 Original line number Diff line number Diff line Loading @@ -7080,24 +7080,22 @@ void Dbdih::execDIGETPRIMREQ(Signal* signal) ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE); connectPtr.i = signal->theData[0]; if(connectPtr.i != RNIL){ if(connectPtr.i != RNIL) { jam(); ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord); ndbrequire(connectPtr.p->connectState == ConnectRecord::INUSE); getFragstore(tabPtr.p, fragId, fragPtr); connectPtr.p->nodeCount = extractNodeInfo(fragPtr.p, connectPtr.p->nodes); signal->theData[0] = connectPtr.p->userpointer; signal->theData[1] = passThrough; signal->theData[2] = connectPtr.p->nodes[0]; sendSignal(connectPtr.p->userblockref, GSN_DIGETPRIMCONF, signal, 3, JBB); return; }//if //connectPtr.i == RNIL -> question without connect record } else { jam(); signal->theData[0] = RNIL; } Uint32 nodes[MAX_REPLICAS]; getFragstore(tabPtr.p, fragId, fragPtr); Uint32 count = extractNodeInfo(fragPtr.p, nodes); signal->theData[0] = RNIL; signal->theData[1] = passThrough; signal->theData[2] = nodes[0]; signal->theData[3] = nodes[1]; Loading ndb/src/kernel/blocks/dblqh/Dblqh.hpp +19 −0 Original line number Diff line number Diff line Loading @@ -2925,4 +2925,23 @@ Dblqh::ScanRecord::check_scan_batch_completed() const (max_bytes > 0 && (m_curr_batch_size_bytes >= max_bytes)); } inline void Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) { if (index == 0) { acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; } else { Uint32 attr_buf_index, attr_buf_rec; AttrbufPtr regAttrPtr; jam(); attr_buf_rec= (index + 31) / 32; attr_buf_index= (index - 1) & 31; regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; } } #endif ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +27 −27 Original line number Diff line number Diff line Loading @@ -7161,10 +7161,7 @@ void Dblqh::continueScanNextReqLab(Signal* signal) // Update timer on tcConnectRecord tcConnectptr.p->tcTimer = cLqhTimeOutCount; init_acc_ptr_list(scanptr.p); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; scanptr.p->scanFlag = NextScanReq::ZSCAN_NEXT; scanNextLoopLab(signal); }//Dblqh::continueScanNextReqLab() Loading Loading @@ -7363,22 +7360,32 @@ void Dblqh::scanLockReleasedLab(Signal* signal) tcConnectptr.i = scanptr.p->scanTcrec; ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); releaseActiveFrag(signal); if (scanptr.p->scanReleaseCounter == scanptr.p->m_curr_batch_size_rows) { if ((scanptr.p->scanErrorCounter > 0) || (scanptr.p->scanCompletedStatus == ZTRUE)) { jam(); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes = 0; closeScanLab(signal); } else if (scanptr.p->check_scan_batch_completed() && scanptr.p->scanLockHold != ZTRUE) { jam(); scanptr.p->scanState = ScanRecord::WAIT_SCAN_NEXTREQ; sendScanFragConf(signal, ZFALSE); } else if (scanptr.p->m_last_row && !scanptr.p->scanLockHold) { jam(); closeScanLab(signal); return; } else { jam(); /* We came here after releasing locks after receiving SCAN_NEXTREQ from TC. We only come here when scanHoldLock == ZTRUE * We came here after releasing locks after * receiving SCAN_NEXTREQ from TC. We only come here * when scanHoldLock == ZTRUE */ scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes = 0; continueScanNextReqLab(signal); }//if } else if (scanptr.p->scanReleaseCounter < scanptr.p->m_curr_batch_size_rows) { Loading Loading @@ -7465,25 +7472,6 @@ Dblqh::init_acc_ptr_list(ScanRecord* scanP) scanP->scan_acc_index = 0; } inline void Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) { if (index == 0) { acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; } else { Uint32 attr_buf_index, attr_buf_rec; AttrbufPtr regAttrPtr; jam(); attr_buf_rec= (index + 31) / 32; attr_buf_index= (index - 1) & 31; regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; } } Uint32 Dblqh::get_acc_ptr_from_scan_record(ScanRecord* scanP, Uint32 index, Loading Loading @@ -8007,6 +7995,13 @@ void Dblqh::nextScanConfScanLab(Signal* signal) /************************************************************* * STOP THE SCAN PROCESS IF THIS HAS BEEN REQUESTED. ************************************************************ */ if (!scanptr.p->scanLockHold) { jam(); closeScanLab(signal); return; } if (scanptr.p->scanCompletedStatus == ZTRUE) { if ((scanptr.p->scanLockHold == ZTRUE) && (scanptr.p->m_curr_batch_size_rows > 0)) { Loading Loading @@ -8507,8 +8502,6 @@ void Dblqh::tupScanCloseConfLab(Signal* signal) ScanFragRef::SignalLength, JBB); } else { jam(); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; sendScanFragConf(signal, ZSCAN_FRAG_CLOSED); }//if finishScanrec(signal); Loading Loading @@ -8912,6 +8905,13 @@ void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted) conf->total_len= total_len; sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGCONF, signal, ScanFragConf::SignalLength, JBB); if(!scanptr.p->scanLockHold) { jam(); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; } }//Dblqh::sendScanFragConf() /* ######################################################################### */ Loading Loading
ndb/docs/wl2077.txt 0 → 100644 +35 −0 Original line number Diff line number Diff line 100' * (select 1 from T1 (1M rows) where key = rand()); 1 host, 1 ndbd, api co-hosted results in 1000 rows / sec wo/reset bounds w/ rb 4.1-read committed a) 4.9 b) 7.4 4.1-read hold lock c) 4.7 d) 6.7 wl2077-read committed 6.4 (+30%) 10.8 (+45%) wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) -- Comparision e) serial pk: 10.9' batched (1000): 59' serial uniq index: 8.4' batched (1000): 33' index range (1000): 186' ---- load) testScanPerf -c 1 -d 1 T1 a) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 0 T1 b) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 1 T1 c) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 0 T1 d) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 1 T1 e) testReadPerf -i 25 -c 0 -d 0 T1 --- music join 1db-co 2db-co 4.1 13s 14s 4.1 wo/ blobs 1.7s 3.2s wl2077 12s 14s wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%)
ndb/src/kernel/blocks/dbdih/Dbdih.hpp +0 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,6 @@ public: Uint32 nfConnect; Uint32 table; Uint32 userpointer; Uint32 nodeCount; BlockReference userblockref; }; typedef Ptr<ConnectRecord> ConnectRecordPtr; Loading
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +9 −11 Original line number Diff line number Diff line Loading @@ -7080,24 +7080,22 @@ void Dbdih::execDIGETPRIMREQ(Signal* signal) ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE); connectPtr.i = signal->theData[0]; if(connectPtr.i != RNIL){ if(connectPtr.i != RNIL) { jam(); ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord); ndbrequire(connectPtr.p->connectState == ConnectRecord::INUSE); getFragstore(tabPtr.p, fragId, fragPtr); connectPtr.p->nodeCount = extractNodeInfo(fragPtr.p, connectPtr.p->nodes); signal->theData[0] = connectPtr.p->userpointer; signal->theData[1] = passThrough; signal->theData[2] = connectPtr.p->nodes[0]; sendSignal(connectPtr.p->userblockref, GSN_DIGETPRIMCONF, signal, 3, JBB); return; }//if //connectPtr.i == RNIL -> question without connect record } else { jam(); signal->theData[0] = RNIL; } Uint32 nodes[MAX_REPLICAS]; getFragstore(tabPtr.p, fragId, fragPtr); Uint32 count = extractNodeInfo(fragPtr.p, nodes); signal->theData[0] = RNIL; signal->theData[1] = passThrough; signal->theData[2] = nodes[0]; signal->theData[3] = nodes[1]; Loading
ndb/src/kernel/blocks/dblqh/Dblqh.hpp +19 −0 Original line number Diff line number Diff line Loading @@ -2925,4 +2925,23 @@ Dblqh::ScanRecord::check_scan_batch_completed() const (max_bytes > 0 && (m_curr_batch_size_bytes >= max_bytes)); } inline void Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) { if (index == 0) { acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; } else { Uint32 attr_buf_index, attr_buf_rec; AttrbufPtr regAttrPtr; jam(); attr_buf_rec= (index + 31) / 32; attr_buf_index= (index - 1) & 31; regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; } } #endif
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +27 −27 Original line number Diff line number Diff line Loading @@ -7161,10 +7161,7 @@ void Dblqh::continueScanNextReqLab(Signal* signal) // Update timer on tcConnectRecord tcConnectptr.p->tcTimer = cLqhTimeOutCount; init_acc_ptr_list(scanptr.p); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; scanptr.p->scanFlag = NextScanReq::ZSCAN_NEXT; scanNextLoopLab(signal); }//Dblqh::continueScanNextReqLab() Loading Loading @@ -7363,22 +7360,32 @@ void Dblqh::scanLockReleasedLab(Signal* signal) tcConnectptr.i = scanptr.p->scanTcrec; ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); releaseActiveFrag(signal); if (scanptr.p->scanReleaseCounter == scanptr.p->m_curr_batch_size_rows) { if ((scanptr.p->scanErrorCounter > 0) || (scanptr.p->scanCompletedStatus == ZTRUE)) { jam(); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes = 0; closeScanLab(signal); } else if (scanptr.p->check_scan_batch_completed() && scanptr.p->scanLockHold != ZTRUE) { jam(); scanptr.p->scanState = ScanRecord::WAIT_SCAN_NEXTREQ; sendScanFragConf(signal, ZFALSE); } else if (scanptr.p->m_last_row && !scanptr.p->scanLockHold) { jam(); closeScanLab(signal); return; } else { jam(); /* We came here after releasing locks after receiving SCAN_NEXTREQ from TC. We only come here when scanHoldLock == ZTRUE * We came here after releasing locks after * receiving SCAN_NEXTREQ from TC. We only come here * when scanHoldLock == ZTRUE */ scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes = 0; continueScanNextReqLab(signal); }//if } else if (scanptr.p->scanReleaseCounter < scanptr.p->m_curr_batch_size_rows) { Loading Loading @@ -7465,25 +7472,6 @@ Dblqh::init_acc_ptr_list(ScanRecord* scanP) scanP->scan_acc_index = 0; } inline void Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) { if (index == 0) { acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; } else { Uint32 attr_buf_index, attr_buf_rec; AttrbufPtr regAttrPtr; jam(); attr_buf_rec= (index + 31) / 32; attr_buf_index= (index - 1) & 31; regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; } } Uint32 Dblqh::get_acc_ptr_from_scan_record(ScanRecord* scanP, Uint32 index, Loading Loading @@ -8007,6 +7995,13 @@ void Dblqh::nextScanConfScanLab(Signal* signal) /************************************************************* * STOP THE SCAN PROCESS IF THIS HAS BEEN REQUESTED. ************************************************************ */ if (!scanptr.p->scanLockHold) { jam(); closeScanLab(signal); return; } if (scanptr.p->scanCompletedStatus == ZTRUE) { if ((scanptr.p->scanLockHold == ZTRUE) && (scanptr.p->m_curr_batch_size_rows > 0)) { Loading Loading @@ -8507,8 +8502,6 @@ void Dblqh::tupScanCloseConfLab(Signal* signal) ScanFragRef::SignalLength, JBB); } else { jam(); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; sendScanFragConf(signal, ZSCAN_FRAG_CLOSED); }//if finishScanrec(signal); Loading Loading @@ -8912,6 +8905,13 @@ void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted) conf->total_len= total_len; sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGCONF, signal, ScanFragConf::SignalLength, JBB); if(!scanptr.p->scanLockHold) { jam(); scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; } }//Dblqh::sendScanFragConf() /* ######################################################################### */ Loading