List:Commits« Previous MessageNext Message »
From:Pekka Nousiainen Date:May 4 2011 10:51am
Subject:bzr commit into mysql-5.1-telco-7.0-wl4163 branch (pekka:4352) WL#4163
View as plain text  
#At file:///export/space/pekka/ms/ms-wl4163-70/ based on revid:pekka@stripped

 4352 Pekka Nousiainen	2011-05-04
      wl#4163 f01_desc.diff
      remove duplicated metadata from frag level

    modified:
      storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp	2011-04-25 16:46:59 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp	2011-05-04 10:51:37 +0000
@@ -451,8 +451,8 @@ private:
     Uint32 m_descPage;          // descriptor page
     Uint16 m_descOff;           // offset within the page
     Uint16 m_numAttrs;
-    bool m_storeNullKey;
     union {
+    bool m_storeNullKey;
     Uint32 nextPool;
     };
     Index();
@@ -473,10 +473,6 @@ private:
     Uint32 m_indexId;
     Uint16 unused;
     Uint16 m_fragId;
-    Uint32 m_descPage;          // copy from index level
-    Uint16 m_descOff;
-    Uint16 m_numAttrs;
-    bool m_storeNullKey;
     TreeHead m_tree;
     TupLoc m_freeLoc;           // one free node for next op
     DLList<ScanOp> m_scanList;  // current scans on this fragment
@@ -1013,17 +1009,13 @@ Dbtux::Frag::Frag(ArrayPool<ScanOp>& sca
   m_tableId(RNIL),
   m_indexId(RNIL),
   m_fragId(ZNIL),
-  m_descPage(RNIL),
-  m_descOff(0),
-  m_numAttrs(ZNIL),
-  m_storeNullKey(false),
   m_tree(),
   m_freeLoc(),
   m_scanList(scanOpPool),
-  m_tupIndexFragPtrI(RNIL)
+  m_tupIndexFragPtrI(RNIL),
+  m_tupTableFragPtrI(RNIL),
+  m_accTableFragPtrI(RNIL)
 {
-  m_tupTableFragPtrI = RNIL;
-  m_accTableFragPtrI = RNIL;
 }
 
 // Dbtux::FragOp

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp	2011-04-24 13:10:50 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp	2011-05-04 10:51:37 +0000
@@ -110,10 +110,10 @@ Dbtux::mt_buildIndexFragment(mt_BuildInd
 
     // read search key
     readKeyAttrs(ctx, frag, ent, 0, ctx.c_searchKey);
-    if (! frag.m_storeNullKey)
+    if (! indexPtr.p->m_storeNullKey)
     {
       // check if all keys are null
-      const unsigned numAttrs = frag.m_numAttrs;
+      const unsigned numAttrs = indexPtr.p->m_numAttrs;
       bool allNull = true;
       for (unsigned i = 0; i < numAttrs; i++)
       {

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp	2011-05-04 10:51:37 +0000
@@ -32,8 +32,9 @@ int
 Dbtux::cmpSearchKey(TuxCtx& ctx,
                     const Frag& frag, unsigned& start, ConstData searchKey, ConstData entryData, unsigned maxlen)
 {
-  const unsigned numAttrs = frag.m_numAttrs;
-  const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff);
+  const Index& index = *c_indexPool.getPtr(frag.m_indexId);
+  const unsigned numAttrs = index.m_numAttrs;
+  const DescEnt& descEnt = getDescEnt(index.m_descPage, index.m_descOff);
   // skip to right position in search key only
   for (unsigned i = 0; i < start; i++) {
     thrjam(ctx.jamBuffer);
@@ -118,7 +119,8 @@ Dbtux::cmpSearchKey(TuxCtx& ctx,
 int
 Dbtux::cmpScanBound(const Frag& frag, unsigned idir, ConstData boundInfo, unsigned boundCount, ConstData entryData, unsigned maxlen)
 {
-  const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff);
+  const Index& index = *c_indexPool.getPtr(frag.m_indexId);
+  const DescEnt& descEnt = getDescEnt(index.m_descPage, index.m_descOff);
   // direction 0-lower 1-upper
   ndbrequire(idir <= 1);
   // number of words of data left
@@ -138,9 +140,9 @@ Dbtux::cmpScanBound(const Frag& frag, un
       if (! ah(entryData).isNULL()) {
         jam();
         // verify attribute id
-        const Uint32 index = ah(boundInfo).getAttributeId();
-        ndbrequire(index < frag.m_numAttrs);
-        const DescAttr& descAttr = descEnt.m_descAttr[index];
+        const Uint32 attrId = ah(boundInfo).getAttributeId();
+        ndbrequire(attrId < index.m_numAttrs);
+        const DescAttr& descAttr = descEnt.m_descAttr[attrId];
         ndbrequire(ah(entryData).getAttributeId() == descAttr.m_primaryAttrId);
         // sizes
         const unsigned bytes1 = ah(boundInfo).getByteSize();
@@ -148,7 +150,7 @@ Dbtux::cmpScanBound(const Frag& frag, un
         const unsigned size2 = min(ah(entryData).getDataSize(), len2);
         len2 -= size2;
         // compare
-        NdbSqlUtil::Cmp* const cmp = c_ctx.c_sqlCmp[index];
+        NdbSqlUtil::Cmp* const cmp = c_ctx.c_sqlCmp[attrId];
         const Uint32* const p1 = &boundInfo[AttributeHeaderSize];
         const Uint32* const p2 = &entryData[AttributeHeaderSize];
         const bool full = (maxlen == MaxAttrDataSize);

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp	2011-04-24 16:20:23 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp	2011-05-04 10:51:37 +0000
@@ -488,9 +488,6 @@ operator<<(NdbOut& out, const Dbtux::Fra
   out << " [tableId " << dec << frag.m_tableId << "]";
   out << " [indexId " << dec << frag.m_indexId << "]";
   out << " [fragId " << dec << frag.m_fragId << "]";
-  out << " [descPage " << hex << frag.m_descPage << "]";
-  out << " [descOff " << dec << frag.m_descOff << "]";
-  out << " [numAttrs " << dec << frag.m_numAttrs << "]";
   out << " [tree " << frag.m_tree << "]";
   out << "]";
   return out;

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp	2011-04-24 13:10:50 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp	2011-05-04 10:51:37 +0000
@@ -249,10 +249,11 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signa
 void
 Dbtux::setKeyAttrs(TuxCtx& ctx, const Frag& frag)
 {
+  const Index& index = *c_indexPool.getPtr(frag.m_indexId);
   Data keyAttrs = ctx.c_keyAttrs;
   NdbSqlUtil::Cmp** sqlCmp = ctx.c_sqlCmp; // global
-  const unsigned numAttrs = frag.m_numAttrs;
-  const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff);
+  const unsigned numAttrs = index.m_numAttrs;
+  const DescEnt& descEnt = getDescEnt(index.m_descPage, index.m_descOff);
   for (unsigned i = 0; i < numAttrs; i++) {
     thrjam(ctx.jamBuffer);
     const DescAttr& descAttr = descEnt.m_descAttr[i];
@@ -270,12 +271,13 @@ Dbtux::setKeyAttrs(TuxCtx& ctx, const Fr
 void
 Dbtux::readKeyAttrs(TuxCtx& ctx, const Frag& frag, TreeEnt ent, unsigned start, Data keyData)
 {
+  const Index& index = *c_indexPool.getPtr(frag.m_indexId);
   ConstData keyAttrs = ctx.c_keyAttrs;
   const Uint32 tableFragPtrI = frag.m_tupTableFragPtrI;
   const TupLoc tupLoc = ent.m_tupLoc;
   const Uint32 tupVersion = ent.m_tupVersion;
-  ndbrequire(start < frag.m_numAttrs);
-  const Uint32 numAttrs = frag.m_numAttrs - start;
+  ndbrequire(start < index.m_numAttrs);
+  const Uint32 numAttrs = index.m_numAttrs - start;
   // skip to start position in keyAttrs only
   keyAttrs += start;
   int ret = c_tup->tuxReadAttrs(ctx.jamBuffer,
@@ -289,7 +291,7 @@ Dbtux::readKeyAttrs(TuxCtx& ctx, const F
     debugOut << "readKeyAttrs:" << endl;
     ConstData data = keyData;
     Uint32 totalSize = 0;
-    for (Uint32 i = start; i < frag.m_numAttrs; i++) {
+    for (Uint32 i = start; i < index.m_numAttrs; i++) {
       Uint32 attrId = ah(data).getAttributeId();
       Uint32 dataSize = ah(data).getDataSize();
       debugOut << i << " attrId=" << attrId << " size=" << dataSize;
@@ -325,7 +327,8 @@ Dbtux::readTablePk(const Frag& frag, Tre
 void
 Dbtux::copyAttrs(TuxCtx& ctx, const Frag& frag, ConstData data1, Data data2, unsigned maxlen2)
 {
-  unsigned n = frag.m_numAttrs;
+  const Index& index = *c_indexPool.getPtr(frag.m_indexId);
+  unsigned n = index.m_numAttrs;
   unsigned len2 = maxlen2;
   while (n != 0) {
     thrjam(ctx.jamBuffer);

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp	2011-04-25 14:42:38 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp	2011-05-04 10:51:37 +0000
@@ -74,9 +74,9 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
   ent.m_tupVersion = req->tupVersion;
   // read search key
   readKeyAttrs(c_ctx, frag, ent, 0, c_ctx.c_searchKey);
-  if (! frag.m_storeNullKey) {
+  if (! indexPtr.p->m_storeNullKey) {
     // check if all keys are null
-    const unsigned numAttrs = frag.m_numAttrs;
+    const unsigned numAttrs = indexPtr.p->m_numAttrs;
     bool allNull = true;
     for (unsigned i = 0; i < numAttrs; i++) {
       if (c_ctx.c_searchKey[i] != 0) {

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp	2011-04-24 16:20:23 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp	2011-05-04 10:51:37 +0000
@@ -278,8 +278,6 @@ Dbtux::execTUXFRAGREQ(Signal* signal)
     fragPtr.p->m_tableId = req->primaryTableId;
     fragPtr.p->m_indexId = req->tableId;
     fragPtr.p->m_fragId = req->fragId;
-    fragPtr.p->m_numAttrs = indexPtr.p->m_numAttrs;
-    fragPtr.p->m_storeNullKey = true;  // not yet configurable
     fragPtr.p->m_tupIndexFragPtrI = req->tupIndexFragPtrI;
     fragPtr.p->m_tupTableFragPtrI = req->tupTableFragPtrI;
     fragPtr.p->m_accTableFragPtrI = req->accTableFragPtrI;
@@ -288,10 +286,6 @@ Dbtux::execTUXFRAGREQ(Signal* signal)
     indexPtr.p->m_fragId[indexPtr.p->m_numFrags] = req->fragId;
     indexPtr.p->m_fragPtrI[indexPtr.p->m_numFrags] = fragPtr.i;
     indexPtr.p->m_numFrags++;
-
-    // copy metadata address to each fragment
-    fragPtr.p->m_descPage = indexPtr.p->m_descPage;
-    fragPtr.p->m_descOff = indexPtr.p->m_descOff;
 #ifdef VM_TRACE
     if (debugFlags & DebugMeta) {
       debugOut << "Add frag " << fragPtr.i << " " << *fragPtr.p << endl;
@@ -602,16 +596,8 @@ Dbtux::freeDescEnt(IndexPtr indexPtr)
       data[off + i] = data[off + size + i];
     }
     off += size2;
-    // adjust page offset in index and all fragments
+    // adjust page offset in index
     index2.m_descOff -= size;
-    for (i = 0; i < index2.m_numFrags; i++) {
-      jam();
-      Frag& frag2 = *c_fragPool.getPtr(index2.m_fragPtrI[i]);
-      frag2.m_descOff -= size;
-      ndbrequire(
-          frag2.m_descPage == index2.m_descPage &&
-          frag2.m_descOff == index2.m_descOff);
-    }
   }
   ndbrequire(off + size == DescPageSize - pagePtr.p->m_numFree);
   pagePtr.p->m_numFree += size;

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp	2011-04-27 21:13:10 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp	2011-05-04 10:51:37 +0000
@@ -34,8 +34,9 @@
 void
 Dbtux::findNodeToUpdate(TuxCtx& ctx, Frag& frag, ConstData searchKey, TreeEnt searchEnt, NodeHandle& currNode)
 {
+  const Index& index = *c_indexPool.getPtr(frag.m_indexId);
   const TreeHead& tree = frag.m_tree;
-  const Uint32 numAttrs = frag.m_numAttrs;
+  const Uint32 numAttrs = index.m_numAttrs;
   NodeHandle glbNode(frag);     // potential g.l.b of final node
   while (true) {
     thrjam(ctx.jamBuffer);


Attachment: [text/bzr-bundle] bzr/pekka@mysql.com-20110504105137-xraapncth2akcai3.bundle
Thread
bzr commit into mysql-5.1-telco-7.0-wl4163 branch (pekka:4352) WL#4163Pekka Nousiainen4 May