Reverting the gen stats
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index 8fee7a4..35547a2 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -100,7 +100,7 @@
if(QUICKSTEP_HAVE_LIBNUMA)
target_link_libraries(quickstep_cli_DefaultsConfigurator
${LIBNUMA_LIBRARY})
-endif()
+endif()
target_link_libraries(quickstep_cli_InputParserUtil
glog
quickstep_utility_Macros
@@ -114,6 +114,7 @@
quickstep_catalog_CatalogAttribute
quickstep_catalog_CatalogRelation
quickstep_storage_StorageBlock
+ quickstep_storage_StorageBlockBase
quickstep_storage_StorageBlockInfo
quickstep_storage_StorageManager
quickstep_storage_TupleIdSequence
diff --git a/cli/CommandExecutor.cpp b/cli/CommandExecutor.cpp
index 3cb3f86..86773d7 100644
--- a/cli/CommandExecutor.cpp
+++ b/cli/CommandExecutor.cpp
@@ -94,7 +94,7 @@
max_column_width = std::max(static_cast<int>(relation->getName().length()),
max_column_width);
num_blocks.push_back(relation->size_blocks());
- num_tuples.push_back(PrintToScreen::GetNumTuplesInRelation(
+ num_tuples.push_back(PrintToScreen::GetNumTuplesInRelation(
*relation,
storage_manager));
}
@@ -103,7 +103,7 @@
const std::size_t max_num_blocks = *std::max_element(num_blocks.begin(), num_blocks.end());
const std::size_t max_num_rows = *std::max_element(num_tuples.begin(), num_tuples.end());
const int max_num_rows_digits = std::max(PrintToScreen::GetNumberOfDigits(max_num_rows),
- C::kInitMaxColumnWidth);
+ C::kInitMaxColumnWidth);
const int max_num_blocks_digits = std::max(PrintToScreen::GetNumberOfDigits(max_num_blocks),
C::kInitMaxColumnWidth+2);
diff --git a/cli/PrintToScreen.cpp b/cli/PrintToScreen.cpp
index 76e90eb..62f1563 100644
--- a/cli/PrintToScreen.cpp
+++ b/cli/PrintToScreen.cpp
@@ -26,6 +26,7 @@
#include "catalog/CatalogAttribute.hpp"
#include "catalog/CatalogRelation.hpp"
#include "storage/StorageBlock.hpp"
+#include "storage/StorageBlockBase.hpp"
#include "storage/StorageBlockInfo.hpp"
#include "storage/StorageManager.hpp"
#include "storage/TupleIdSequence.hpp"
@@ -164,8 +165,9 @@
const std::vector<block_id> &blocks = relation.getBlocksSnapshot();
std::size_t total_num_tuples = 0;
for (block_id block : blocks) {
- total_num_tuples +=
- storage_manager->getBlock(block, relation)->getNumTuples();
+ MutableBlockReference curr_block = storage_manager->getBlockMutable(block, relation);
+ total_num_tuples += curr_block->getNumTuples();
+ curr_block.release();
}
return total_num_tuples;
}
diff --git a/query_optimizer/ExecutionGenerator.cpp b/query_optimizer/ExecutionGenerator.cpp
index 612efd9..34f317e 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -949,14 +949,14 @@
scan_operator_index,
false /* is_pipeline_breaker */);
- const QueryPlan::DAGNodeIndex num_rows_operator_index =
+ /*const QueryPlan::DAGNodeIndex num_rows_operator_index =
execution_plan_->addRelationalOperator(new GenerateNumRowsStatsOperator(
optimizer_context_->catalog_database()->getRelationByIdMutable(
output_relation->getID())));
insert_destination_proto->set_relational_op_index(num_rows_operator_index);
execution_plan_->addDirectDependency(num_rows_operator_index,
scan_operator_index,
- true /* is_pipeline_breaker */);
+ true // is_pipeline_breaker);*/
}
void ExecutionGenerator::convertCreateIndex(