|
52 | 52 | #include "storage/ndb/include/ndb_global.h" |
53 | 53 | #include "storage/ndb/include/ndb_version.h" |
54 | 54 | #include "storage/ndb/include/ndbapi/NdbApi.hpp" |
55 | | -#include "storage/ndb/include/ndbapi/NdbIndexStat.hpp" |
56 | | -#include "storage/ndb/include/ndbapi/NdbInterpretedCode.hpp" |
57 | 55 | #include "storage/ndb/include/util/SparseBitmask.hpp" |
58 | 56 | #include "storage/ndb/plugin/ha_ndb_index_stat.h" |
59 | 57 | #include "storage/ndb/plugin/ha_ndbcluster_binlog.h" |
@@ -12553,12 +12551,6 @@ void ha_ndbcluster::set_tabname(const char *path_name) { |
12553 | 12551 | ndb_set_tabname(path_name, m_tabname); |
12554 | 12552 | } |
12555 | 12553 |
|
12556 | | -/* |
12557 | | - If there are no stored stats, should we do a tree-dive on all db |
12558 | | - nodes. The result is fairly good but does mean a round-trip. |
12559 | | - */ |
12560 | | -static const bool g_ndb_records_in_range_tree_dive = false; |
12561 | | - |
12562 | 12554 | /* Determine roughly how many records are in the range specified */ |
12563 | 12555 | ha_rows ha_ndbcluster::records_in_range(uint inx, key_range *min_key, |
12564 | 12556 | key_range *max_key) { |
@@ -12615,41 +12607,6 @@ ha_rows ha_ndbcluster::records_in_range(uint inx, key_range *min_key, |
12615 | 12607 | } |
12616 | 12608 | /*fall through*/ |
12617 | 12609 | } |
12618 | | - |
12619 | | - if (g_ndb_records_in_range_tree_dive) { |
12620 | | - NDB_INDEX_DATA &d = m_index[inx]; |
12621 | | - const NDBINDEX *index = d.index; |
12622 | | - Ndb *ndb = get_ndb(thd); |
12623 | | - NdbTransaction *active_trans = m_thd_ndb ? m_thd_ndb->trans : 0; |
12624 | | - NdbTransaction *trans = NULL; |
12625 | | - int res = 0; |
12626 | | - Uint64 rows; |
12627 | | - |
12628 | | - do { |
12629 | | - if ((trans = active_trans) == NULL || |
12630 | | - trans->commitStatus() != NdbTransaction::Started) { |
12631 | | - DBUG_PRINT("info", ("no active trans")); |
12632 | | - if (!(trans = ndb->startTransaction())) |
12633 | | - ERR_BREAK(ndb->getNdbError(), res); |
12634 | | - } |
12635 | | - |
12636 | | - /* Create an IndexBound struct for the keys */ |
12637 | | - NdbIndexScanOperation::IndexBound ib; |
12638 | | - compute_index_bounds(ib, key_info, min_key, max_key, 0); |
12639 | | - |
12640 | | - ib.range_no = 0; |
12641 | | - |
12642 | | - NdbIndexStat is; |
12643 | | - if (is.records_in_range(index, trans, d.ndb_record_key, m_ndb_record, |
12644 | | - &ib, 0, &rows, 0) == -1) |
12645 | | - ERR_BREAK(is.getNdbError(), res); |
12646 | | - } while (0); |
12647 | | - |
12648 | | - if (trans != active_trans && rows == 0) rows = 1; |
12649 | | - if (trans != active_trans && trans != NULL) ndb->closeTransaction(trans); |
12650 | | - if (res == 0) return rows; |
12651 | | - /*fall through*/ |
12652 | | - } |
12653 | 12610 | } |
12654 | 12611 |
|
12655 | 12612 | /* Use simple heuristics to estimate fraction |
|
0 commit comments