List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:August 30 2010 1:20pm
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3256 to
3257)
View as plain text  
 3257 Jonas Oreland	2010-08-30
      ndb - spj-scan-scan, change counter definition for SCAN_[ROWS/BATCHES]_RETURNED

    modified:
      mysql-test/suite/ndb/r/ndb_join_pushdown.result
      scripts/mysql_system_tables.sql
      storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp
      storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
      storage/ndb/src/kernel/vm/Ndbinfo.hpp
      storage/ndb/tools/ndbinfo_sql.cpp
 3256 Ole John Aske	2010-08-28
      Add MTR testcase for const-prune index scan. Also verify prune execution by using ndbinfo counters

    modified:
      mysql-test/suite/ndb/r/ndb_join_pushdown.result
      mysql-test/suite/ndb/t/ndb_join_pushdown.test
=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown.result	2010-08-27 22:49:22 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown.result	2010-08-30 12:45:53 +0000
@@ -3081,8 +3081,8 @@ RANGE_SCANS_RECEIVED	2
 READS_NOT_FOUND	2
 READS_RECEIVED	1
 REMOTE_RANGE_SCANS_SENT	0
-SCAN_BATCHES_COMPLETED	4
-SCAN_ROWS_RETURNED	5
+SCAN_BATCHES_RETURNED	4
+SCAN_ROWS_RETURNED	8
 TABLE_SCANS_RECEIVED	2
 select 'READS_SENT', sum(new_count.val - old_count.val) 
 from new_count, old_count 

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2010-08-27 22:45:29 +0000
+++ b/scripts/mysql_system_tables.sql	2010-08-30 12:45:53 +0000
@@ -324,7 +324,7 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 # ndbinfo.counters
-SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`counters` AS SELECT node_id, b.block_name, block_instance, counter_id, CASE counter_id  WHEN 1 THEN "ATTRINFO"  WHEN 2 THEN "TRANSACTIONS"  WHEN 3 THEN "COMMITS"  WHEN 4 THEN "READS"  WHEN 5 THEN "SIMPLE_READS"  WHEN 6 THEN "WRITES"  WHEN 7 THEN "ABORTS"  WHEN 8 THEN "TABLE_SCANS"  WHEN 9 THEN "RANGE_SCANS"  WHEN 10 THEN "OPERATIONS"  WHEN 11 THEN "READS_RECEIVED"  WHEN 12 THEN "LOCAL_READS_SENT"  WHEN 13 THEN "REMOTE_READS_SENT"  WHEN 14 THEN "READS_NOT_FOUND"  WHEN 15 THEN "TABLE_SCANS_RECEIVED"  WHEN 16 THEN "LOCAL_TABLE_SCANS_SENT"  WHEN 17 THEN "RANGE_SCANS_RECEIVED"  WHEN 18 THEN "LOCAL_RANGE_SCANS_SENT"  WHEN 19 THEN "REMOTE_RANGE_SCANS_SENT"  WHEN 20 THEN "SCAN_BATCHES_COMPLETED"  WHEN 21 THEN "SCAN_ROWS_RETURNED"  WHEN 22 THEN "PRUNED_RANGE_SCANS_RECEIVED"  WHEN 23 THEN "CONST_PRUNED_RANGE_SCANS_RECEIVED"  ELSE "<unknown>"  END AS counter_name, val FROM ndbinfo
 .ndb$counters c, ndbinfo.blocks b WHERE c.block_number = b.block_number','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`counters` AS SELECT node_id, b.block_name, block_instance, counter_id, CASE counter_id  WHEN 1 THEN "ATTRINFO"  WHEN 2 THEN "TRANSACTIONS"  WHEN 3 THEN "COMMITS"  WHEN 4 THEN "READS"  WHEN 5 THEN "SIMPLE_READS"  WHEN 6 THEN "WRITES"  WHEN 7 THEN "ABORTS"  WHEN 8 THEN "TABLE_SCANS"  WHEN 9 THEN "RANGE_SCANS"  WHEN 10 THEN "OPERATIONS"  WHEN 11 THEN "READS_RECEIVED"  WHEN 12 THEN "LOCAL_READS_SENT"  WHEN 13 THEN "REMOTE_READS_SENT"  WHEN 14 THEN "READS_NOT_FOUND"  WHEN 15 THEN "TABLE_SCANS_RECEIVED"  WHEN 16 THEN "LOCAL_TABLE_SCANS_SENT"  WHEN 17 THEN "RANGE_SCANS_RECEIVED"  WHEN 18 THEN "LOCAL_RANGE_SCANS_SENT"  WHEN 19 THEN "REMOTE_RANGE_SCANS_SENT"  WHEN 20 THEN "SCAN_BATCHES_RETURNED"  WHEN 21 THEN "SCAN_ROWS_RETURNED"  WHEN 22 THEN "PRUNED_RANGE_SCANS_RECEIVED"  WHEN 23 THEN "CONST_PRUNED_RANGE_SCANS_RECEIVED"  ELSE "<unknown>"  END AS counter_name, val FROM ndbinfo.
 ndb$counters c, ndbinfo.blocks b WHERE c.block_number = b.block_number','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;

=== modified file 'storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp	2010-08-27 12:17:19 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp	2010-08-30 12:45:53 +0000
@@ -837,9 +837,9 @@ private:
     CI_REMOTE_RANGE_SCANS_SENT = 8,
     
     /**
-     * No of scan batches (on range or full table) which has completed.
+     * No of scan batches (on range or full table) returned to ndbapi
      */
-    CI_SCAN_BATCHES_COMPLETED = 9,
+    CI_SCAN_BATCHES_RETURNED = 9,
 
     /**
      * Total no of rows returned from scans.

=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2010-08-27 22:45:29 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2010-08-30 12:45:53 +0000
@@ -1150,6 +1150,9 @@ Dbspj::sendConf(Signal* signal, Ptr<Requ
       conf->fragmentCompleted = is_complete ? 1 : 0;
       conf->total_len = requestPtr.p->m_active_nodes.rep.data[0];
 
+      c_Counters.incr_counter(CI_SCAN_BATCHES_RETURNED, 1);
+      c_Counters.incr_counter(CI_SCAN_ROWS_RETURNED, requestPtr.p->m_rows);
+
       /**
        * reset for next batch
        */
@@ -3804,9 +3807,6 @@ Dbspj::scanFrag_execSCAN_FRAGCONF(Signal
   
   ndbrequire(done <= 2); // 0, 1, 2 (=ZSCAN_FRAG_CLOSED)
 
-  c_Counters.incr_counter(CI_SCAN_BATCHES_COMPLETED, 1);
-  c_Counters.incr_counter(CI_SCAN_ROWS_RETURNED, rows);
-
   ndbassert(treeNodePtr.p->m_scanfrag_data.m_rows_expecting == ~Uint32(0));
   treeNodePtr.p->m_scanfrag_data.m_rows_expecting = rows;
   if (treeNodePtr.p->isLeaf())
@@ -4839,8 +4839,6 @@ Dbspj::scanIndex_execSCAN_FRAGCONF(Signa
   Uint32 done = conf->fragmentCompleted;
 
   requestPtr.p->m_rows += rows;
-  c_Counters.incr_counter(CI_SCAN_BATCHES_COMPLETED, 1);
-  c_Counters.incr_counter(CI_SCAN_ROWS_RETURNED, rows);
 
   ScanIndexData& data = treeNodePtr.p->m_scanindex_data;
 
@@ -6371,8 +6369,8 @@ void Dbspj::execDBINFO_SCANREQ(Signal *s
         c_Counters.get_counter(CI_LOCAL_RANGE_SCANS_SENT) },
       { Ndbinfo::SPJ_REMOTE_RANGE_SCANS_SENT_COUNTER, 
         c_Counters.get_counter(CI_REMOTE_RANGE_SCANS_SENT) },
-      { Ndbinfo::SPJ_SCAN_BATCHES_COMPLETED_COUNTER, 
-        c_Counters.get_counter(CI_SCAN_BATCHES_COMPLETED) },
+      { Ndbinfo::SPJ_SCAN_BATCHES_RETURNED_COUNTER, 
+        c_Counters.get_counter(CI_SCAN_BATCHES_RETURNED) },
       { Ndbinfo::SPJ_SCAN_ROWS_RETURNED_COUNTER, 
         c_Counters.get_counter(CI_SCAN_ROWS_RETURNED) },
       { Ndbinfo::SPJ_PRUNED_RANGE_SCANS_RECEIVED_COUNTER, 

=== modified file 'storage/ndb/src/kernel/vm/Ndbinfo.hpp'
--- a/storage/ndb/src/kernel/vm/Ndbinfo.hpp	2010-08-27 22:45:29 +0000
+++ b/storage/ndb/src/kernel/vm/Ndbinfo.hpp	2010-08-30 12:45:53 +0000
@@ -187,7 +187,7 @@ public:
     SPJ_RANGE_SCANS_RECEIVED_COUNTER = 17,
     SPJ_LOCAL_RANGE_SCANS_SENT_COUNTER = 18,
     SPJ_REMOTE_RANGE_SCANS_SENT_COUNTER = 19,
-    SPJ_SCAN_BATCHES_COMPLETED_COUNTER = 20,
+    SPJ_SCAN_BATCHES_RETURNED_COUNTER = 20,
     SPJ_SCAN_ROWS_RETURNED_COUNTER = 21,
     SPJ_PRUNED_RANGE_SCANS_RECEIVED_COUNTER = 22,
     SPJ_CONST_PRUNED_RANGE_SCANS_RECEIVED_COUNTER = 23

=== modified file 'storage/ndb/tools/ndbinfo_sql.cpp'
--- a/storage/ndb/tools/ndbinfo_sql.cpp	2010-08-27 22:45:29 +0000
+++ b/storage/ndb/tools/ndbinfo_sql.cpp	2010-08-30 12:45:53 +0000
@@ -127,7 +127,7 @@ struct view {
     "  WHEN 17 THEN \"RANGE_SCANS_RECEIVED\""
     "  WHEN 18 THEN \"LOCAL_RANGE_SCANS_SENT\""
     "  WHEN 19 THEN \"REMOTE_RANGE_SCANS_SENT\""
-    "  WHEN 20 THEN \"SCAN_BATCHES_COMPLETED\""
+    "  WHEN 20 THEN \"SCAN_BATCHES_RETURNED\""
     "  WHEN 21 THEN \"SCAN_ROWS_RETURNED\""
     "  WHEN 22 THEN \"PRUNED_RANGE_SCANS_RECEIVED\""
     "  WHEN 23 THEN \"CONST_PRUNED_RANGE_SCANS_RECEIVED\""


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100830124553-rh724ujb081ppait.bundle
Thread
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3256 to3257) Jonas Oreland30 Aug