Implemented general purpose psuedo columns: row_count & fragment

Implemented new interpreter instruction: exit_ok_last

This two new features combined can be used to make fast select count
 


ndb/include/kernel/AttributeHeader.hpp:
  Psuedo columns fragment & row_count
ndb/include/kernel/GlobalSignalNumbers.h:
  Impl. READ_ROWCOUNT
ndb/include/kernel/signaldata/TupKey.hpp:
  Remove unused pageId pageIndex and replace with lastRow flag
ndb/include/ndbapi/NdbOperation.hpp:
  New instruction for last_row
ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
  REQ_ROWCOUNT
ndb/src/kernel/blocks/dbacc/DbaccInit.cpp:
  REQ_ROWCOUNT
ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  REQ_ROWCOUNT
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  REQ_ROWCOUNT + last row
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
  REQ_ROWCOUNT
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  REQ_ROWCOUNT + last row
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Add readers for new psuedo columns
ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Add readers for new psuedo columns
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
  Add readers for new psuedo columns
ndb/src/ndbapi/NdbOperationDefine.cpp:
  Use exit ok (not ok_last)
ndb/src/ndbapi/NdbOperationExec.cpp:
  Use exit ok (not ok_last)
ndb/src/ndbapi/NdbOperationInt.cpp:
  New instruction
This commit is contained in:
unknown 2004-08-24 23:27:32 +02:00
commit d2c8f1a762
16 changed files with 128 additions and 34 deletions

View file

@ -708,7 +708,7 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regOperPtr->tupleState = TUPLE_BLOCKED;
regOperPtr->changeMask.clear();
if (Rstoredid != ZNIL) {
ndbrequire(initStoredOperationrec(regOperPtr, Rstoredid) == ZOK);
}//if
@ -844,20 +844,18 @@ void Dbtup::sendTUPKEYCONF(Signal* signal,
TupKeyConf * const tupKeyConf = (TupKeyConf *)signal->getDataPtrSend();
Uint32 RuserPointer = regOperPtr->userpointer;
Uint32 RfragPageId = regOperPtr->fragPageId;
Uint32 RpageIndex = regOperPtr->pageIndex;
Uint32 RattroutbufLen = regOperPtr->attroutbufLen;
Uint32 RnoFiredTriggers = regOperPtr->noFiredTriggers;
BlockReference Ruserblockref = regOperPtr->userblockref;
Uint32 lastRow = regOperPtr->lastRow;
regOperPtr->transstate = STARTED;
regOperPtr->tupleState = NO_OTHER_OP;
tupKeyConf->userPtr = RuserPointer;
tupKeyConf->pageId = RfragPageId;
tupKeyConf->pageIndex = RpageIndex;
tupKeyConf->readLength = RattroutbufLen;
tupKeyConf->writeLength = TlogSize;
tupKeyConf->noFiredTriggers = RnoFiredTriggers;
tupKeyConf->lastRow = lastRow;
EXECUTE_DIRECT(refToBlock(Ruserblockref), GSN_TUPKEYCONF, signal,
TupKeyConf::SignalLength);
@ -920,6 +918,7 @@ int Dbtup::handleReadReq(Signal* signal,
return -1;
} else {
jam();
regOperPtr->lastRow = 0;
if (interpreterStartLab(signal, pagePtr, Ttupheadoffset) != -1) {
return 0;
}//if
@ -1978,12 +1977,19 @@ int Dbtup::interpreterNextLab(Signal* signal,
}
case Interpreter::EXIT_OK:
case Interpreter::EXIT_OK_LAST:
jam();
#ifdef TRACE_INTERPRETER
ndbout_c(" - exit_ok");
#endif
return TdataWritten;
case Interpreter::EXIT_OK_LAST:
jam();
#if 1
ndbout_c(" - exit_ok_last");
#endif
operPtr.p->lastRow = 1;
return TdataWritten;
case Interpreter::EXIT_REFUSE:
jam();