diff --git a/sql/sql_load.cc b/sql/sql_load.cc index ecd40a27b..01b883fab 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -51,7 +51,7 @@ #include -#include "../storage/tianmu/handler/ha_my_tianmu.h" // tianmu code +#include "../storage/tianmu/sql/ha_my_tianmu.h" // tianmu code using std::min; using std::max; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a5a4f7483..4e534fd81 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -118,7 +118,7 @@ #include "rpl_group_replication.h" #include -#include "../storage/tianmu/handler/ha_my_tianmu.h" // tianmu code +#include "../storage/tianmu/sql/ha_my_tianmu.h" // tianmu code using std::max; /** diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 837ac4d37..1dec5be78 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -77,7 +77,7 @@ #include #include -#include "../storage/tianmu/handler/ha_my_tianmu.h" // TIANMU UPGRADE +#include "../storage/tianmu/sql/ha_my_tianmu.h" // TIANMU UPGRADE using std::max; using std::min; diff --git a/storage/tianmu/CMakeLists.txt b/storage/tianmu/CMakeLists.txt index 3302e1e6b..9449b05bd 100644 --- a/storage/tianmu/CMakeLists.txt +++ b/storage/tianmu/CMakeLists.txt @@ -55,6 +55,14 @@ AUX_SOURCE_DIRECTORY(base/core SOURCE_base_core) AUX_SOURCE_DIRECTORY(base/fmt SOURCE_base_fmt) AUX_SOURCE_DIRECTORY(base/net SOURCE_base_net) AUX_SOURCE_DIRECTORY(base/util SOURCE_base_util) +AUX_SOURCE_DIRECTORY(optimizer SOURCE_optimizer) +AUX_SOURCE_DIRECTORY(optimizer/compile SOURCE_compile) +AUX_SOURCE_DIRECTORY(optimizer/iterators SOURCE_iterators) +AUX_SOURCE_DIRECTORY(optimizer/statistics SOURCE_statistics) +AUX_SOURCE_DIRECTORY(optimizer/plan SOURCE_plan) +AUX_SOURCE_DIRECTORY(executor SOURCE_executor) +AUX_SOURCE_DIRECTORY(data SOURCE_data) +AUX_SOURCE_DIRECTORY(sql SOURCE_sql) SET(TIANMU_SOURCES ${SOURCE_common} ${SOURCE_compress} @@ -72,7 +80,16 @@ SET(TIANMU_SOURCES ${SOURCE_common} ${SOURCE_base_core} ${SOURCE_base_fmt} ${SOURCE_base_net} - ${SOURCE_base_util}) + ${SOURCE_base_util} + ${SOURCE_optimizer} + ${SOURCE_compile} + ${SOURCE_iterators} + ${SOURCE_statistics} + ${SOURCE_plan} + ${SOURCE_executor} + ${SOURCE_data} + ${SOURCE_sql} + ) MYSQL_ADD_PLUGIN(tianmu ${TIANMU_SOURCES} STORAGE_ENGINE diff --git a/storage/tianmu/async_tests/task_executor.cpp b/storage/tianmu/async_tests/task_executor.cpp index 57d65c9ee..dcb0933c2 100644 --- a/storage/tianmu/async_tests/task_executor.cpp +++ b/storage/tianmu/async_tests/task_executor.cpp @@ -19,7 +19,7 @@ #include "base/core/app_template.h" #include "base/core/future.h" -#include "core/task_executor.h" +#include "executor/task_executor.h" #ifndef DISABLE_USED_FOR_TIANMU #include "core/engine.h" diff --git a/storage/tianmu/compress/basic_data_filt.h b/storage/tianmu/compress/basic_data_filt.h index e195b6d09..5db0a147b 100644 --- a/storage/tianmu/compress/basic_data_filt.h +++ b/storage/tianmu/compress/basic_data_filt.h @@ -22,8 +22,8 @@ #include "compress/data_filt.h" #include "compress/dictionary.h" -#include "core/bin_tools.h" #include "core/quick_math.h" +#include "util/bin_tools.h" namespace Tianmu { namespace compress { diff --git a/storage/tianmu/compress/dictionary.cpp b/storage/tianmu/compress/dictionary.cpp index 03ca77927..1a0ce71d7 100644 --- a/storage/tianmu/compress/dictionary.cpp +++ b/storage/tianmu/compress/dictionary.cpp @@ -19,7 +19,7 @@ #include -#include "core/bin_tools.h" +#include "util/bin_tools.h" #include "util/qsort.h" namespace Tianmu { diff --git a/storage/tianmu/compress/num_compressor.h b/storage/tianmu/compress/num_compressor.h index 4bf01e771..0405030a7 100644 --- a/storage/tianmu/compress/num_compressor.h +++ b/storage/tianmu/compress/num_compressor.h @@ -25,8 +25,8 @@ #include "compress/range_code.h" #include "compress/top_bit_dict.h" #include "core/quick_math.h" -#include "core/tools.h" #include "system/fet.h" +#include "util/tools.h" namespace Tianmu { namespace compress { diff --git a/storage/tianmu/compress/range_code.h b/storage/tianmu/compress/range_code.h index b0c2b47dd..bb5a3b83f 100644 --- a/storage/tianmu/compress/range_code.h +++ b/storage/tianmu/compress/range_code.h @@ -23,7 +23,7 @@ #include "common/assert.h" #include "common/exception.h" #include "compress/defs.h" -#include "core/bin_tools.h" +#include "util/bin_tools.h" namespace Tianmu { namespace compress { diff --git a/storage/tianmu/core/data_cache.cpp b/storage/tianmu/core/data_cache.cpp index 632d44ba7..9b3cbba61 100644 --- a/storage/tianmu/core/data_cache.cpp +++ b/storage/tianmu/core/data_cache.cpp @@ -17,7 +17,7 @@ #include "data_cache.h" -#include "core/tianmu_attr.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/data_cache.h b/storage/tianmu/core/data_cache.h index 6997eb384..2340fd486 100644 --- a/storage/tianmu/core/data_cache.h +++ b/storage/tianmu/core/data_cache.h @@ -24,7 +24,7 @@ #include #include -#include "core/pack.h" +#include "data/pack.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/delta_table.h b/storage/tianmu/core/delta_table.h index 9751c87df..b1d27f05d 100644 --- a/storage/tianmu/core/delta_table.h +++ b/storage/tianmu/core/delta_table.h @@ -22,13 +22,13 @@ #include "common/exception.h" #include "core/delta_record_head.h" -#include "core/tianmu_attr.h" #include "index/kv_store.h" #include "rocksdb/db.h" #include "rocksdb/iterator.h" #include "rocksdb/slice.h" #include "types/tianmu_data_types.h" #include "util/bitset.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/dimension_group.h b/storage/tianmu/core/dimension_group.h index e8aeeb792..4968192d6 100644 --- a/storage/tianmu/core/dimension_group.h +++ b/storage/tianmu/core/dimension_group.h @@ -18,10 +18,10 @@ #define TIANMU_CORE_DIMENSION_GROUP_H_ #pragma once -#include "core/bin_tools.h" #include "core/dimension_vector.h" -#include "core/filter.h" -#include "core/index_table.h" +#include "executor/filter.h" +#include "index/index_table.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/dimension_group_multiple.h b/storage/tianmu/core/dimension_group_multiple.h index 2ae523d2f..442fbd117 100644 --- a/storage/tianmu/core/dimension_group_multiple.h +++ b/storage/tianmu/core/dimension_group_multiple.h @@ -20,10 +20,10 @@ #include -#include "core/bin_tools.h" #include "core/dimension_group.h" -#include "core/filter.h" -#include "core/index_table.h" +#include "executor/filter.h" +#include "index/index_table.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/engine.cpp b/storage/tianmu/core/engine.cpp index 2a899895e..ff36e99e6 100644 --- a/storage/tianmu/core/engine.cpp +++ b/storage/tianmu/core/engine.cpp @@ -28,10 +28,9 @@ #include "common/mysql_gate.h" #include "core/delta_table.h" #include "core/table_share.h" -#include "core/task_executor.h" #include "core/temp_table.h" -#include "core/tools.h" #include "core/transaction.h" +#include "executor/task_executor.h" #include "mm/initializer.h" #include "mm/memory_statistics.h" #include "mysql/thread_pool_priv.h" @@ -43,6 +42,7 @@ #include "util/bitset.h" #include "util/fs.h" #include "util/thread_pool.h" +#include "util/tools.h" namespace Tianmu { namespace DBHandler { diff --git a/storage/tianmu/core/engine.h b/storage/tianmu/core/engine.h index 1c90ece31..00c084988 100644 --- a/storage/tianmu/core/engine.h +++ b/storage/tianmu/core/engine.h @@ -26,13 +26,13 @@ #include "common/assert.h" #include "common/exception.h" -#include "core/combined_iterator.h" #include "core/data_cache.h" #include "core/object_cache.h" #include "core/query.h" #include "core/table_share.h" #include "core/temp_table.h" #include "core/tianmu_table.h" +#include "executor/combined_iterator.h" #include "exporter/data_exporter.h" #include "exporter/export2file.h" #include "index/tianmu_table_index.h" diff --git a/storage/tianmu/core/engine_execute.cpp b/storage/tianmu/core/engine_execute.cpp index c8be65a3f..c901b974f 100644 --- a/storage/tianmu/core/engine_execute.cpp +++ b/storage/tianmu/core/engine_execute.cpp @@ -19,8 +19,11 @@ #include #include -#include "core/compilation_tools.h" -#include "core/compiled_query.h" +#include "optimizer/compile//compiled_query.h" +#include "optimizer/compile/compilation_tools.h" +#include "optimizer/compile/compiler.h" +#include "optimizer/plan/query_plan.h" + #include "core/engine.h" #include "core/query.h" #include "core/transaction.h" diff --git a/storage/tianmu/core/ftree.h b/storage/tianmu/core/ftree.h index 679e53c7f..6dd182c87 100644 --- a/storage/tianmu/core/ftree.h +++ b/storage/tianmu/core/ftree.h @@ -20,9 +20,9 @@ #define TIANMU_CORE_FTREE_H_ #pragma once -#include "core/bin_tools.h" #include "mm/traceable_object.h" #include "types/tianmu_data_types.h" +#include "util/bin_tools.h" #include "util/fs.h" namespace Tianmu { diff --git a/storage/tianmu/core/hash_table.cpp b/storage/tianmu/core/hash_table.cpp index dea5cc62b..9a7978f95 100644 --- a/storage/tianmu/core/hash_table.cpp +++ b/storage/tianmu/core/hash_table.cpp @@ -19,8 +19,8 @@ #include "common/assert.h" #include "core/hash_table.h" -#include "core/rough_multi_index.h" #include "core/transaction.h" +#include "index/rough_multi_index.h" #include "system/fet.h" namespace Tianmu { diff --git a/storage/tianmu/core/hash_table.h b/storage/tianmu/core/hash_table.h index 3baa980a4..aa2b23e0b 100644 --- a/storage/tianmu/core/hash_table.h +++ b/storage/tianmu/core/hash_table.h @@ -22,8 +22,8 @@ #include #include "base/util/spinlock.h" -#include "core/bin_tools.h" #include "mm/traceable_object.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/item_tianmu_field.cpp b/storage/tianmu/core/item_tianmu_field.cpp index cbe32733a..90a88537a 100644 --- a/storage/tianmu/core/item_tianmu_field.cpp +++ b/storage/tianmu/core/item_tianmu_field.cpp @@ -18,9 +18,9 @@ #include "item_tianmu_field.h" #include "common/assert.h" -#include "core/compilation_tools.h" #include "core/quick_math.h" #include "core/transaction.h" +#include "optimizer/compile/compilation_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/item_tianmu_field.h b/storage/tianmu/core/item_tianmu_field.h index 75ca61a8f..f72bbe0ec 100644 --- a/storage/tianmu/core/item_tianmu_field.h +++ b/storage/tianmu/core/item_tianmu_field.h @@ -23,9 +23,9 @@ #include #include "common/common_definitions.h" -#include "core/data_type.h" #include "core/value_or_null.h" #include "core/var_id.h" +#include "types/data_type.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/joner_hash.h b/storage/tianmu/core/joner_hash.h index 6dd0cb22a..13af8efe9 100644 --- a/storage/tianmu/core/joner_hash.h +++ b/storage/tianmu/core/joner_hash.h @@ -18,8 +18,8 @@ #define TIANMU_CORE_JONER_HASH_H_ #pragma once -#include "core/joiner.h" -#include "core/joiner_hash_table.h" +#include "optimizer/joiner.h" +#include "optimizer/joiner_hash_table.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/just_a_table.cpp b/storage/tianmu/core/just_a_table.cpp index ae3278a21..4c5c178a9 100644 --- a/storage/tianmu/core/just_a_table.cpp +++ b/storage/tianmu/core/just_a_table.cpp @@ -18,9 +18,9 @@ #include "just_a_table.h" #include "common/assert.h" -#include "core/cq_term.h" -#include "core/filter.h" #include "core/temp_table.h" +#include "executor/filter.h" +#include "optimizer/compile/cq_term.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/mysql_expression.cpp b/storage/tianmu/core/mysql_expression.cpp index 40f141ac7..2e34fbb80 100644 --- a/storage/tianmu/core/mysql_expression.cpp +++ b/storage/tianmu/core/mysql_expression.cpp @@ -18,10 +18,10 @@ #include "mysql_expression.h" #include "common/assert.h" -#include "core/compilation_tools.h" #include "core/engine.h" #include "core/transaction.h" #include "item_timefunc.h" +#include "optimizer/compile/compilation_tools.h" #include "types/value_parser4txt.h" namespace Tianmu { diff --git a/storage/tianmu/core/parallel_hash_join.cpp b/storage/tianmu/core/parallel_hash_join.cpp index 9d2d5142e..02f07fd4e 100644 --- a/storage/tianmu/core/parallel_hash_join.cpp +++ b/storage/tianmu/core/parallel_hash_join.cpp @@ -19,13 +19,13 @@ #include "common/assert.h" #include "core/engine.h" -#include "core/join_thread_table.h" -#include "core/joiner_hash.h" #include "core/parallel_hash_join.h" #include "core/proxy_hash_joiner.h" -#include "core/task_executor.h" #include "core/temp_table.h" #include "core/transaction.h" +#include "executor/join_thread_table.h" +#include "executor/task_executor.h" +#include "optimizer/joiner_hash.h" #include "system/fet.h" #include "util/thread_pool.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/core/parallel_hash_join.h b/storage/tianmu/core/parallel_hash_join.h index b1f52bd8c..5bd0ec598 100644 --- a/storage/tianmu/core/parallel_hash_join.h +++ b/storage/tianmu/core/parallel_hash_join.h @@ -22,10 +22,10 @@ #include #include -#include "core/column_bin_encoder.h" #include "core/hash_table.h" -#include "core/joiner.h" -#include "core/multi_index_builder.h" +#include "index/multi_index_builder.h" +#include "optimizer/joiner.h" +#include "vc/column_bin_encoder.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/parameterized_filter.cpp b/storage/tianmu/core/parameterized_filter.cpp index f5983bab0..41fccdad3 100644 --- a/storage/tianmu/core/parameterized_filter.cpp +++ b/storage/tianmu/core/parameterized_filter.cpp @@ -17,17 +17,17 @@ #include "parameterized_filter.h" -#include "core/condition_encoder.h" #include "core/engine.h" -#include "core/joiner.h" -#include "core/mi_iterator.h" -#include "core/mi_updating_iterator.h" -#include "core/pack_orderer.h" #include "core/query.h" -#include "core/rough_multi_index.h" #include "core/temp_table.h" #include "core/transaction.h" #include "core/value_set.h" +#include "data/pack_orderer.h" +#include "index/rough_multi_index.h" +#include "optimizer/condition_encoder.h" +#include "optimizer/iterators/mi_iterator.h" +#include "optimizer/iterators/mi_updating_iterator.h" +#include "optimizer/joiner.h" #include "util/thread_pool.h" #include "vc/const_column.h" #include "vc/const_expr_column.h" diff --git a/storage/tianmu/core/parameterized_filter.h b/storage/tianmu/core/parameterized_filter.h index d227d4a52..fa95f9d06 100644 --- a/storage/tianmu/core/parameterized_filter.h +++ b/storage/tianmu/core/parameterized_filter.h @@ -18,11 +18,11 @@ #define TIANMU_CORE_PARAMETERIZED_FILTER_H_ #pragma once -#include "core/condition.h" -#include "core/cq_term.h" -#include "core/joiner.h" #include "core/just_a_table.h" -#include "core/multi_index.h" +#include "index/multi_index.h" +#include "optimizer/compile/cq_term.h" +#include "optimizer/condition.h" +#include "optimizer/joiner.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/proxy_hash_joiner.cpp b/storage/tianmu/core/proxy_hash_joiner.cpp index eca9bd0a7..fc7cd8fb8 100644 --- a/storage/tianmu/core/proxy_hash_joiner.cpp +++ b/storage/tianmu/core/proxy_hash_joiner.cpp @@ -23,16 +23,16 @@ #include "base/util/defer.h" #include "common/assert.h" #include "common/exception.h" -#include "core/column_bin_encoder.h" #include "core/engine.h" -#include "core/join_thread_table.h" -#include "core/mi_step_iterator.h" -#include "core/multi_index_builder.h" -#include "core/task_executor.h" #include "core/temp_table.h" #include "core/transaction.h" +#include "executor/join_thread_table.h" +#include "executor/task_executor.h" +#include "index/multi_index_builder.h" +#include "optimizer/iterators/mi_step_iterator.h" #include "proxy_hash_joiner.h" #include "system/fet.h" +#include "vc/column_bin_encoder.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/proxy_hash_joiner.h b/storage/tianmu/core/proxy_hash_joiner.h index 4949e94f3..0353a9182 100644 --- a/storage/tianmu/core/proxy_hash_joiner.h +++ b/storage/tianmu/core/proxy_hash_joiner.h @@ -20,7 +20,7 @@ #include -#include "core/joiner.h" +#include "optimizer/joiner.h" namespace Tianmu { namespace core { @@ -41,4 +41,4 @@ class ProxyHashJoiner : public TwoDimensionalJoiner { } // namespace core } // namespace Tianmu -#endif // TIANMU_CORE_PROXY_HASH_JOINER_H_ \ No newline at end of file +#endif // TIANMU_CORE_PROXY_HASH_JOINER_H_ diff --git a/storage/tianmu/core/query.cpp b/storage/tianmu/core/query.cpp index 1079b2b35..011fce21d 100644 --- a/storage/tianmu/core/query.cpp +++ b/storage/tianmu/core/query.cpp @@ -18,16 +18,16 @@ #include "query.h" #include "common/common_definitions.h" -#include "compiled_query.h" -#include "core/compilation_tools.h" -#include "core/cq_term.h" #include "core/engine.h" #include "core/mysql_expression.h" #include "core/parameterized_filter.h" -#include "core/rough_multi_index.h" #include "core/temp_table.h" #include "core/transaction.h" #include "core/value_set.h" +#include "index/rough_multi_index.h" +#include "optimizer/compile/compilation_tools.h" +#include "optimizer/compile/compiled_query.h" +#include "optimizer/compile/cq_term.h" #include "vc/const_column.h" #include "vc/const_expr_column.h" #include "vc/expr_column.h" diff --git a/storage/tianmu/core/query.h b/storage/tianmu/core/query.h index 8c074f7a8..001f85df5 100644 --- a/storage/tianmu/core/query.h +++ b/storage/tianmu/core/query.h @@ -18,11 +18,11 @@ #define TIANMU_CORE_QUERY_H_ #pragma once -#include "core/column_type.h" #include "core/item_tianmu_field.h" -#include "core/joiner.h" #include "core/mysql_expression.h" -#include "handler/ha_my_tianmu.h" +#include "optimizer/joiner.h" +#include "sql/ha_my_tianmu.h" +#include "vc/column_type.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/query_compile.cpp b/storage/tianmu/core/query_compile.cpp index 39719f4fc..859df32d7 100644 --- a/storage/tianmu/core/query_compile.cpp +++ b/storage/tianmu/core/query_compile.cpp @@ -18,12 +18,12 @@ #include #include "common/mysql_gate.h" -#include "core/compilation_tools.h" -#include "core/compiled_query.h" #include "core/engine.h" #include "core/mysql_expression.h" #include "core/query.h" #include "core/transaction.h" +#include "optimizer/compile/compilation_tools.h" +#include "optimizer/compile/compiled_query.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/quick_math.h b/storage/tianmu/core/quick_math.h index 2582631b5..971944818 100644 --- a/storage/tianmu/core/quick_math.h +++ b/storage/tianmu/core/quick_math.h @@ -22,7 +22,7 @@ #include "common/assert.h" #include "common/common_definitions.h" -#include "core/bin_tools.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/table_share.h b/storage/tianmu/core/table_share.h index 35b2bc940..bb00c93a9 100644 --- a/storage/tianmu/core/table_share.h +++ b/storage/tianmu/core/table_share.h @@ -20,7 +20,7 @@ #include "common/common_definitions.h" #include "common/defs.h" -#include "core/column_share.h" +#include "vc/column_share.h" #include #include diff --git a/storage/tianmu/core/temp_table.cpp b/storage/tianmu/core/temp_table.cpp index 5f83a5c2c..ba7736979 100644 --- a/storage/tianmu/core/temp_table.cpp +++ b/storage/tianmu/core/temp_table.cpp @@ -17,20 +17,20 @@ #include -#include "core/aggregation_algorithm.h" #include "core/cached_buffer.h" -#include "core/column_bin_encoder.h" -#include "core/condition_encoder.h" #include "core/engine.h" -#include "core/group_distinct_table.h" #include "core/mysql_expression.h" #include "core/parameterized_filter.h" #include "core/query.h" -#include "core/rsi_cmap.h" #include "core/temp_table.h" #include "core/transaction.h" #include "core/value_set.h" +#include "index/rsi_cmap.h" +#include "optimizer/aggregation_algorithm.h" +#include "optimizer/condition_encoder.h" +#include "optimizer/group_distinct_table.h" #include "system/fet.h" +#include "vc/column_bin_encoder.h" #include "vc/const_column.h" #include "vc/const_expr_column.h" #include "vc/expr_column.h" diff --git a/storage/tianmu/core/temp_table.h b/storage/tianmu/core/temp_table.h index 05b142e90..e96d9088d 100644 --- a/storage/tianmu/core/temp_table.h +++ b/storage/tianmu/core/temp_table.h @@ -21,18 +21,18 @@ #include #include "common/common_definitions.h" -#include "core/cq_term.h" -#include "core/descriptor.h" #include "core/just_a_table.h" -#include "core/mi_updating_iterator.h" -#include "core/multi_index.h" #include "core/mysql_expression.h" -#include "core/pack_orderer.h" #include "core/parameterized_filter.h" -#include "core/physical_column.h" -#include "core/sorter_wrapper.h" +#include "data/pack_orderer.h" #include "exporter/data_exporter.h" +#include "index/multi_index.h" +#include "optimizer/compile/cq_term.h" +#include "optimizer/compile/descriptor.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "system/large_buffer.h" +#include "util/sorter_wrapper.h" +#include "vc/physical_column.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/temp_table_com.cpp b/storage/tianmu/core/temp_table_com.cpp index b2ffc0fd5..07b0baa20 100644 --- a/storage/tianmu/core/temp_table_com.cpp +++ b/storage/tianmu/core/temp_table_com.cpp @@ -15,9 +15,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/filter.h" #include "core/query.h" #include "core/temp_table.h" +#include "executor/filter.h" #include "vc/const_column.h" #include "vc/const_expr_column.h" diff --git a/storage/tianmu/core/temp_table_low.cpp b/storage/tianmu/core/temp_table_low.cpp index 2c6b20827..265eeae53 100644 --- a/storage/tianmu/core/temp_table_low.cpp +++ b/storage/tianmu/core/temp_table_low.cpp @@ -23,16 +23,16 @@ #include "common/assert.h" #include "common/data_format.h" #include "core/engine.h" -#include "core/pack_guardian.h" -#include "core/sorter_wrapper.h" #include "core/temp_table.h" #include "core/transaction.h" +#include "data/pack_guardian.h" #include "exporter/data_exporter.h" #include "system/fet.h" #include "system/io_parameters.h" #include "system/tianmu_system.h" #include "system/txt_utils.h" #include "types/value_parser4txt.h" +#include "util/sorter_wrapper.h" #include "util/thread_pool.h" #include "vc/expr_column.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/core/temp_table_roughquery.cpp b/storage/tianmu/core/temp_table_roughquery.cpp index cee8adf97..0a3e2e054 100644 --- a/storage/tianmu/core/temp_table_roughquery.cpp +++ b/storage/tianmu/core/temp_table_roughquery.cpp @@ -21,9 +21,9 @@ */ #include "core/engine.h" -#include "core/mi_iterator.h" -#include "core/pack_orderer.h" #include "core/temp_table.h" +#include "data/pack_orderer.h" +#include "optimizer/iterators/mi_iterator.h" #include "vc/single_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/tianmu_table.cpp b/storage/tianmu/core/tianmu_table.cpp index 31f069752..971fbfd6a 100644 --- a/storage/tianmu/core/tianmu_table.cpp +++ b/storage/tianmu/core/tianmu_table.cpp @@ -23,11 +23,10 @@ #include "common/common_definitions.h" #include "common/exception.h" #include "core/engine.h" -#include "core/pack_guardian.h" #include "core/table_share.h" -#include "core/tianmu_attr.h" #include "core/tianmu_table.h" #include "core/transaction.h" +#include "data/pack_guardian.h" #include "handler/ha_tianmu.h" #include "loader/load_parser.h" #include "log_event.h" @@ -38,6 +37,7 @@ #include "types/value_parser4txt.h" #include "util/bitset.h" #include "util/timer.h" +#include "vc/tianmu_attr.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/tianmu_table.h b/storage/tianmu/core/tianmu_table.h index b28e107d9..efc4976be 100644 --- a/storage/tianmu/core/tianmu_table.h +++ b/storage/tianmu/core/tianmu_table.h @@ -23,9 +23,9 @@ #include "common/common_definitions.h" #include "core/delta_table.h" #include "core/just_a_table.h" -#include "core/tianmu_attr.h" #include "index/tianmu_table_index.h" #include "util/fs.h" +#include "vc/tianmu_attr.h" namespace Tianmu { diff --git a/storage/tianmu/core/transaction.cpp b/storage/tianmu/core/transaction.cpp index dd7e5be6a..a57495fb2 100644 --- a/storage/tianmu/core/transaction.cpp +++ b/storage/tianmu/core/transaction.cpp @@ -17,11 +17,11 @@ #include "core/transaction.h" -#include "core/dpn.h" #include "core/tianmu_table.h" -#include "core/tools.h" +#include "data/dpn.h" #include "system/file_system.h" #include "util/fs.h" +#include "util/tools.h" namespace Tianmu { // current transaction, thread local var. diff --git a/storage/tianmu/core/value_matching_hashtable.cpp b/storage/tianmu/core/value_matching_hashtable.cpp index 643aa5e2f..d585ef3c1 100644 --- a/storage/tianmu/core/value_matching_hashtable.cpp +++ b/storage/tianmu/core/value_matching_hashtable.cpp @@ -17,7 +17,7 @@ #include "value_matching_hashtable.h" -#include "core/bin_tools.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/value_matching_table.h b/storage/tianmu/core/value_matching_table.h index 02e2e7dbc..872c4a8bc 100644 --- a/storage/tianmu/core/value_matching_table.h +++ b/storage/tianmu/core/value_matching_table.h @@ -18,9 +18,9 @@ #define TIANMU_CORE_VALUE_MATCHING_TABLE_H_ #pragma once -#include "core/bin_tools.h" -#include "core/filter.h" +#include "executor/filter.h" #include "mm/traceable_object.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/value_set.cpp b/storage/tianmu/core/value_set.cpp index f1370cad5..8c9c50bf3 100644 --- a/storage/tianmu/core/value_set.cpp +++ b/storage/tianmu/core/value_set.cpp @@ -15,11 +15,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ #include "common/common_definitions.h" -#include "core/filter.h" -#include "core/tianmu_attr_typeinfo.h" +#include "executor/filter.h" #include "types/text_stat.h" #include "types/tianmu_num.h" #include "util/hash64.h" +#include "vc/tianmu_attr_typeinfo.h" #include "value_set.h" diff --git a/storage/tianmu/core/dpn.h b/storage/tianmu/data/dpn.h similarity index 100% rename from storage/tianmu/core/dpn.h rename to storage/tianmu/data/dpn.h diff --git a/storage/tianmu/core/pack.cpp b/storage/tianmu/data/pack.cpp similarity index 97% rename from storage/tianmu/core/pack.cpp rename to storage/tianmu/data/pack.cpp index a80d5c4b8..570f69b1f 100644 --- a/storage/tianmu/core/pack.cpp +++ b/storage/tianmu/data/pack.cpp @@ -15,16 +15,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/pack.h" +#include "data/pack.h" #include "compress/bit_stream_compressor.h" #include "compress/num_compressor.h" -#include "core/bin_tools.h" -#include "core/column_share.h" #include "core/data_cache.h" -#include "core/tools.h" #include "core/value.h" #include "loader/value_cache.h" #include "system/tianmu_file.h" +#include "util/bin_tools.h" +#include "util/tools.h" +#include "vc/column_share.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/pack.h b/storage/tianmu/data/pack.h similarity index 99% rename from storage/tianmu/core/pack.h rename to storage/tianmu/data/pack.h index dd2e1cad8..b3c0e5a6b 100644 --- a/storage/tianmu/core/pack.h +++ b/storage/tianmu/data/pack.h @@ -18,11 +18,11 @@ #define TIANMU_CORE_PACK_H_ #pragma once -#include "core/dpn.h" -#include "core/tools.h" +#include "data/dpn.h" #include "mm/mm_guard.h" #include "mm/traceable_object.h" #include "types/tianmu_data_types.h" +#include "util/tools.h" namespace Tianmu { namespace system { diff --git a/storage/tianmu/core/pack_guardian.cpp b/storage/tianmu/data/pack_guardian.cpp similarity index 96% rename from storage/tianmu/core/pack_guardian.cpp rename to storage/tianmu/data/pack_guardian.cpp index 74a437b95..5613671a1 100644 --- a/storage/tianmu/core/pack_guardian.cpp +++ b/storage/tianmu/data/pack_guardian.cpp @@ -20,7 +20,7 @@ #include "pack_guardian.h" #include "core/just_a_table.h" -#include "core/mi_iterator.h" +#include "optimizer/iterators/mi_iterator.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/pack_guardian.h b/storage/tianmu/data/pack_guardian.h similarity index 100% rename from storage/tianmu/core/pack_guardian.h rename to storage/tianmu/data/pack_guardian.h diff --git a/storage/tianmu/core/pack_int.cpp b/storage/tianmu/data/pack_int.cpp similarity index 99% rename from storage/tianmu/core/pack_int.cpp rename to storage/tianmu/data/pack_int.cpp index 02cf4bc5b..d82837fa3 100644 --- a/storage/tianmu/core/pack_int.cpp +++ b/storage/tianmu/data/pack_int.cpp @@ -15,18 +15,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/pack_int.h" +#include "data/pack_int.h" #include #include #include "compress/bit_stream_compressor.h" #include "compress/num_compressor.h" -#include "core/bin_tools.h" -#include "core/column_share.h" #include "core/value.h" #include "loader/value_cache.h" #include "system/tianmu_file.h" +#include "util/bin_tools.h" +#include "vc/column_share.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/pack_int.h b/storage/tianmu/data/pack_int.h similarity index 99% rename from storage/tianmu/core/pack_int.h rename to storage/tianmu/data/pack_int.h index 46d116ea8..e92cc31cc 100644 --- a/storage/tianmu/core/pack_int.h +++ b/storage/tianmu/data/pack_int.h @@ -18,8 +18,8 @@ #define TIANMU_CORE_PACK_INT_H_ #pragma once -#include "core/pack.h" #include "core/value.h" +#include "data/pack.h" namespace Tianmu { diff --git a/storage/tianmu/core/pack_orderer.cpp b/storage/tianmu/data/pack_orderer.cpp similarity index 99% rename from storage/tianmu/core/pack_orderer.cpp rename to storage/tianmu/data/pack_orderer.cpp index 8b94e27b4..d47ca812e 100644 --- a/storage/tianmu/core/pack_orderer.cpp +++ b/storage/tianmu/data/pack_orderer.cpp @@ -17,7 +17,7 @@ #include "pack_orderer.h" -#include "core/mi_iterator.h" +#include "optimizer/iterators/mi_iterator.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/pack_orderer.h b/storage/tianmu/data/pack_orderer.h similarity index 100% rename from storage/tianmu/core/pack_orderer.h rename to storage/tianmu/data/pack_orderer.h diff --git a/storage/tianmu/core/pack_str.cpp b/storage/tianmu/data/pack_str.cpp similarity index 99% rename from storage/tianmu/core/pack_str.cpp rename to storage/tianmu/data/pack_str.cpp index f5703b744..139b96f8f 100644 --- a/storage/tianmu/core/pack_str.cpp +++ b/storage/tianmu/data/pack_str.cpp @@ -24,9 +24,6 @@ #include "compress/num_compressor.h" #include "compress/part_dict.h" #include "compress/text_compressor.h" -#include "core/bin_tools.h" -#include "core/column_share.h" -#include "core/tools.h" #include "core/value.h" #include "loader/value_cache.h" #include "lz4.h" @@ -34,6 +31,9 @@ #include "system/stream.h" #include "system/tianmu_file.h" #include "system/txt_utils.h" +#include "util/bin_tools.h" +#include "util/tools.h" +#include "vc/column_share.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/pack_str.h b/storage/tianmu/data/pack_str.h similarity index 99% rename from storage/tianmu/core/pack_str.h rename to storage/tianmu/data/pack_str.h index 32c0de922..350d1c050 100644 --- a/storage/tianmu/core/pack_str.h +++ b/storage/tianmu/data/pack_str.h @@ -20,7 +20,7 @@ #include -#include "core/pack.h" +#include "data/pack.h" #include "marisa.h" namespace Tianmu { diff --git a/storage/tianmu/core/combined_iterator.cpp b/storage/tianmu/executor/combined_iterator.cpp similarity index 100% rename from storage/tianmu/core/combined_iterator.cpp rename to storage/tianmu/executor/combined_iterator.cpp diff --git a/storage/tianmu/core/combined_iterator.h b/storage/tianmu/executor/combined_iterator.h similarity index 96% rename from storage/tianmu/core/combined_iterator.h rename to storage/tianmu/executor/combined_iterator.h index fa0562c1a..c11e448ee 100644 --- a/storage/tianmu/core/combined_iterator.h +++ b/storage/tianmu/executor/combined_iterator.h @@ -22,9 +22,9 @@ #ifndef MYSQL_STORAGE_TIANMU_CORE_MERGE_ITERATOR_H_ #define MYSQL_STORAGE_TIANMU_CORE_MERGE_ITERATOR_H_ -#include "delta_table.h" -#include "tianmu_attr_typeinfo.h" -#include "tianmu_table.h" +#include "core/delta_table.h" +#include "core/tianmu_table.h" +#include "vc/tianmu_attr_typeinfo.h" // new iterator not Begin() and End() function; // only use Valid() to check iterator is valid. diff --git a/storage/tianmu/core/ctask.h b/storage/tianmu/executor/ctask.h similarity index 100% rename from storage/tianmu/core/ctask.h rename to storage/tianmu/executor/ctask.h diff --git a/storage/tianmu/core/filter.cpp b/storage/tianmu/executor/filter.cpp similarity index 99% rename from storage/tianmu/core/filter.cpp rename to storage/tianmu/executor/filter.cpp index 8f78bf86b..b59f6758b 100644 --- a/storage/tianmu/core/filter.cpp +++ b/storage/tianmu/executor/filter.cpp @@ -18,7 +18,7 @@ #include "filter.h" #include "common/assert.h" -#include "core/tools.h" +#include "util/tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/filter.h b/storage/tianmu/executor/filter.h similarity index 100% rename from storage/tianmu/core/filter.h rename to storage/tianmu/executor/filter.h diff --git a/storage/tianmu/core/filter_block.cpp b/storage/tianmu/executor/filter_block.cpp similarity index 99% rename from storage/tianmu/core/filter_block.cpp rename to storage/tianmu/executor/filter_block.cpp index 083e25e8f..dfd3d9887 100644 --- a/storage/tianmu/core/filter_block.cpp +++ b/storage/tianmu/executor/filter_block.cpp @@ -16,9 +16,9 @@ */ #include "common/assert.h" -#include "core/bin_tools.h" -#include "core/filter.h" -#include "core/tools.h" +#include "executor/filter.h" +#include "util/bin_tools.h" +#include "util/tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/filter_iterators.cpp b/storage/tianmu/executor/filter_iterators.cpp similarity index 99% rename from storage/tianmu/core/filter_iterators.cpp rename to storage/tianmu/executor/filter_iterators.cpp index 99ba7b68c..b8e96e0b7 100644 --- a/storage/tianmu/core/filter_iterators.cpp +++ b/storage/tianmu/executor/filter_iterators.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/filter.h" -#include "core/pack_orderer.h" +#include "data/pack_orderer.h" +#include "executor/filter.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/join_thread_table.cpp b/storage/tianmu/executor/join_thread_table.cpp similarity index 99% rename from storage/tianmu/core/join_thread_table.cpp rename to storage/tianmu/executor/join_thread_table.cpp index 91b18ecc8..910cfccab 100644 --- a/storage/tianmu/core/join_thread_table.cpp +++ b/storage/tianmu/executor/join_thread_table.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/join_thread_table.h" +#include "executor/join_thread_table.h" #include "base/util/spinlock.h" #include "common/assert.h" diff --git a/storage/tianmu/core/join_thread_table.h b/storage/tianmu/executor/join_thread_table.h similarity index 98% rename from storage/tianmu/core/join_thread_table.h rename to storage/tianmu/executor/join_thread_table.h index a13aae9b3..1debc86d2 100644 --- a/storage/tianmu/core/join_thread_table.h +++ b/storage/tianmu/executor/join_thread_table.h @@ -22,10 +22,10 @@ #include #include "common/assert.h" -#include "core/column_bin_encoder.h" -#include "core/filter.h" #include "core/hash_table.h" #include "core/temp_table.h" +#include "executor/filter.h" +#include "vc/column_bin_encoder.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/merge_operator.cpp b/storage/tianmu/executor/merge_operator.cpp similarity index 99% rename from storage/tianmu/core/merge_operator.cpp rename to storage/tianmu/executor/merge_operator.cpp index f7ba1a500..6d8ba5e7b 100644 --- a/storage/tianmu/core/merge_operator.cpp +++ b/storage/tianmu/executor/merge_operator.cpp @@ -19,7 +19,7 @@ // Created by dfx on 22-12-15. // -#include "core/merge_operator.h" +#include "executor/merge_operator.h" #include "core/delta_record_head.h" #include "core/delta_table.h" #include "util/mapped_circular_buffer.h" diff --git a/storage/tianmu/core/merge_operator.h b/storage/tianmu/executor/merge_operator.h similarity index 100% rename from storage/tianmu/core/merge_operator.h rename to storage/tianmu/executor/merge_operator.h diff --git a/storage/tianmu/core/query_operator.h b/storage/tianmu/executor/query_operator.h similarity index 100% rename from storage/tianmu/core/query_operator.h rename to storage/tianmu/executor/query_operator.h diff --git a/storage/tianmu/core/task_executor.cpp b/storage/tianmu/executor/task_executor.cpp similarity index 98% rename from storage/tianmu/core/task_executor.cpp rename to storage/tianmu/executor/task_executor.cpp index f7ce86ccb..ffa025b0d 100644 --- a/storage/tianmu/core/task_executor.cpp +++ b/storage/tianmu/executor/task_executor.cpp @@ -19,7 +19,7 @@ #include "core/app_template.h" #include "core/future.h" -#include "core/task_executor.h" +#include "executor/task_executor.h" #ifndef DISABLE_USED_FOR_TIANMU #include "core/engine.h" diff --git a/storage/tianmu/core/task_executor.h b/storage/tianmu/executor/task_executor.h similarity index 100% rename from storage/tianmu/core/task_executor.h rename to storage/tianmu/executor/task_executor.h diff --git a/storage/tianmu/exporter/data_exporter.cpp b/storage/tianmu/exporter/data_exporter.cpp index 06a29355b..87bbb2239 100644 --- a/storage/tianmu/exporter/data_exporter.cpp +++ b/storage/tianmu/exporter/data_exporter.cpp @@ -19,8 +19,8 @@ #include "common/assert.h" #include "core/engine.h" -#include "core/tianmu_attr.h" #include "system/large_buffer.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace exporter { diff --git a/storage/tianmu/exporter/data_exporter.h b/storage/tianmu/exporter/data_exporter.h index be112aec2..3829de792 100644 --- a/storage/tianmu/exporter/data_exporter.h +++ b/storage/tianmu/exporter/data_exporter.h @@ -19,10 +19,10 @@ #pragma once #include "common/common_definitions.h" -#include "core/bin_tools.h" #include "system/channel_out.h" #include "system/large_buffer.h" #include "system/txt_utils.h" +#include "util/bin_tools.h" namespace Tianmu { namespace exporter { diff --git a/storage/tianmu/handler/ha_tianmu.cpp b/storage/tianmu/handler/ha_tianmu.cpp index 63003716f..6b6494077 100644 --- a/storage/tianmu/handler/ha_tianmu.cpp +++ b/storage/tianmu/handler/ha_tianmu.cpp @@ -26,18 +26,18 @@ #include "binlog.h" #include "common/assert.h" #include "common/exception.h" -#include "core/compilation_tools.h" -#include "core/compiled_query.h" #include "core/delta_record_head.h" #include "core/temp_table.h" -#include "core/tools.h" #include "core/transaction.h" #include "core/value.h" #include "ha_tianmu.h" #include "mm/initializer.h" +#include "optimizer/compile/compilation_tools.h" +#include "optimizer/compile/compiled_query.h" #include "system/configuration.h" #include "system/file_out.h" #include "util/fs.h" +#include "util/tools.h" #define MYSQL_SERVER 1 diff --git a/storage/tianmu/core/index_table.cpp b/storage/tianmu/index/index_table.cpp similarity index 99% rename from storage/tianmu/core/index_table.cpp rename to storage/tianmu/index/index_table.cpp index f8f7575a2..e065db58a 100644 --- a/storage/tianmu/core/index_table.cpp +++ b/storage/tianmu/index/index_table.cpp @@ -17,8 +17,8 @@ #include "index_table.h" -#include "core/filter.h" #include "core/transaction.h" +#include "executor/filter.h" #include "system/tianmu_system.h" namespace Tianmu { diff --git a/storage/tianmu/core/index_table.h b/storage/tianmu/index/index_table.h similarity index 100% rename from storage/tianmu/core/index_table.h rename to storage/tianmu/index/index_table.h diff --git a/storage/tianmu/index/kv_store.cpp b/storage/tianmu/index/kv_store.cpp index 4990aed8e..7d2f2f001 100644 --- a/storage/tianmu/index/kv_store.cpp +++ b/storage/tianmu/index/kv_store.cpp @@ -18,7 +18,7 @@ #include "index/kv_store.h" #include "core/engine.h" -#include "core/merge_operator.h" +#include "executor/merge_operator.h" namespace Tianmu { namespace index { diff --git a/storage/tianmu/core/mi_new_contents.cpp b/storage/tianmu/index/mi_new_contents.cpp similarity index 98% rename from storage/tianmu/core/mi_new_contents.cpp rename to storage/tianmu/index/mi_new_contents.cpp index 5689ef71c..62eafc7b4 100644 --- a/storage/tianmu/core/mi_new_contents.cpp +++ b/storage/tianmu/index/mi_new_contents.cpp @@ -15,12 +15,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "mi_new_contents.h" +#include "index/mi_new_contents.h" #include "core/dimension_group_virtual.h" -#include "core/joiner.h" -#include "core/mi_rough_sorter.h" -#include "core/multi_index.h" +#include "index/mi_rough_sorter.h" +#include "index/multi_index.h" +#include "optimizer/joiner.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/mi_new_contents.h b/storage/tianmu/index/mi_new_contents.h similarity index 100% rename from storage/tianmu/core/mi_new_contents.h rename to storage/tianmu/index/mi_new_contents.h diff --git a/storage/tianmu/core/mi_rough_sorter.cpp b/storage/tianmu/index/mi_rough_sorter.cpp similarity index 100% rename from storage/tianmu/core/mi_rough_sorter.cpp rename to storage/tianmu/index/mi_rough_sorter.cpp diff --git a/storage/tianmu/core/mi_rough_sorter.h b/storage/tianmu/index/mi_rough_sorter.h similarity index 99% rename from storage/tianmu/core/mi_rough_sorter.h rename to storage/tianmu/index/mi_rough_sorter.h index 2b4a8145b..5008e91ab 100644 --- a/storage/tianmu/core/mi_rough_sorter.h +++ b/storage/tianmu/index/mi_rough_sorter.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_MI_ROUGH_SORTER_H_ #pragma once -#include "core/multi_index.h" +#include "index/multi_index.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/multi_index.cpp b/storage/tianmu/index/multi_index.cpp similarity index 95% rename from storage/tianmu/core/multi_index.cpp rename to storage/tianmu/index/multi_index.cpp index b63679bef..586cf60b6 100644 --- a/storage/tianmu/core/multi_index.cpp +++ b/storage/tianmu/index/multi_index.cpp @@ -17,11 +17,11 @@ #include "multi_index.h" -#include "core/group_distinct_table.h" -#include "core/joiner.h" -#include "core/mi_iterator.h" -#include "core/mi_new_contents.h" -#include "core/tools.h" +#include "index/mi_new_contents.h" +#include "optimizer/group_distinct_table.h" +#include "optimizer/iterators/mi_iterator.h" +#include "optimizer/joiner.h" +#include "util/tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/multi_index.h b/storage/tianmu/index/multi_index.h similarity index 96% rename from storage/tianmu/core/multi_index.h rename to storage/tianmu/index/multi_index.h index aa867b6d9..db319fef2 100644 --- a/storage/tianmu/core/multi_index.h +++ b/storage/tianmu/index/multi_index.h @@ -18,11 +18,11 @@ #define TIANMU_CORE_MULTI_INDEX_H_ #pragma once -#include "core/bin_tools.h" -#include "core/cq_term.h" #include "core/dimension_group.h" -#include "core/filter.h" -#include "core/index_table.h" +#include "executor/filter.h" +#include "index/index_table.h" +#include "optimizer/compile/cq_term.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/multi_index_builder.cpp b/storage/tianmu/index/multi_index_builder.cpp similarity index 98% rename from storage/tianmu/core/multi_index_builder.cpp rename to storage/tianmu/index/multi_index_builder.cpp index 5283d852c..cd2370c2a 100644 --- a/storage/tianmu/core/multi_index_builder.cpp +++ b/storage/tianmu/index/multi_index_builder.cpp @@ -18,9 +18,9 @@ #include "multi_index_builder.h" #include "core/dimension_group_multiple.h" -#include "core/joiner.h" -#include "core/mi_rough_sorter.h" -#include "core/multi_index.h" +#include "index/mi_rough_sorter.h" +#include "index/multi_index.h" +#include "optimizer/joiner.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/multi_index_builder.h b/storage/tianmu/index/multi_index_builder.h similarity index 93% rename from storage/tianmu/core/multi_index_builder.h rename to storage/tianmu/index/multi_index_builder.h index 5a5f4ac39..491420aef 100644 --- a/storage/tianmu/core/multi_index_builder.h +++ b/storage/tianmu/index/multi_index_builder.h @@ -22,13 +22,13 @@ #include #include -#include "core/bin_tools.h" -#include "core/cq_term.h" #include "core/dimension_group.h" -#include "core/filter.h" -#include "core/index_table.h" -#include "core/mi_rough_sorter.h" -#include "core/multi_index.h" +#include "executor/filter.h" +#include "index/index_table.h" +#include "index/mi_rough_sorter.h" +#include "index/multi_index.h" +#include "optimizer/compile/cq_term.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/index/rdb_meta_manager.cpp b/storage/tianmu/index/rdb_meta_manager.cpp index 54b78a38c..360da02da 100644 --- a/storage/tianmu/index/rdb_meta_manager.cpp +++ b/storage/tianmu/index/rdb_meta_manager.cpp @@ -31,7 +31,7 @@ #include "core/delta_table.h" #include "core/engine.h" -#include "core/merge_operator.h" +#include "executor/merge_operator.h" #include "index/kv_store.h" #include "index/rdb_utils.h" diff --git a/storage/tianmu/core/rough_multi_index.cpp b/storage/tianmu/index/rough_multi_index.cpp similarity index 99% rename from storage/tianmu/core/rough_multi_index.cpp rename to storage/tianmu/index/rough_multi_index.cpp index 07f7a8257..a2e303b9c 100644 --- a/storage/tianmu/core/rough_multi_index.cpp +++ b/storage/tianmu/index/rough_multi_index.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "rough_multi_index.h" +#include "index/rough_multi_index.h" #include "core/rough_value.h" namespace Tianmu { diff --git a/storage/tianmu/core/rough_multi_index.h b/storage/tianmu/index/rough_multi_index.h similarity index 97% rename from storage/tianmu/core/rough_multi_index.h rename to storage/tianmu/index/rough_multi_index.h index 100943ace..1e8bd7d96 100644 --- a/storage/tianmu/core/rough_multi_index.h +++ b/storage/tianmu/index/rough_multi_index.h @@ -18,9 +18,9 @@ #define TIANMU_CORE_ROUGH_MULTI_INDEX_H_ #pragma once -#include "core/bin_tools.h" -#include "core/cq_term.h" -#include "core/filter.h" +#include "executor/filter.h" +#include "optimizer/compile/cq_term.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/rsi_bloom.cpp b/storage/tianmu/index/rsi_bloom.cpp similarity index 98% rename from storage/tianmu/core/rsi_bloom.cpp rename to storage/tianmu/index/rsi_bloom.cpp index 79dda12d0..1e725b86f 100644 --- a/storage/tianmu/core/rsi_bloom.cpp +++ b/storage/tianmu/index/rsi_bloom.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/rsi_bloom.h" -#include "core/pack_str.h" +#include "index/rsi_bloom.h" +#include "data/pack_str.h" #include "system/tianmu_file.h" #include "system/tianmu_system.h" diff --git a/storage/tianmu/core/rsi_bloom.h b/storage/tianmu/index/rsi_bloom.h similarity index 98% rename from storage/tianmu/core/rsi_bloom.h rename to storage/tianmu/index/rsi_bloom.h index 4edf39ff5..290140cb1 100644 --- a/storage/tianmu/core/rsi_bloom.h +++ b/storage/tianmu/index/rsi_bloom.h @@ -20,7 +20,7 @@ #include "common/common_definitions.h" #include "core/bloom_block.h" -#include "core/rsi_index.h" +#include "index/rsi_index.h" #include "types/tianmu_data_types.h" namespace Tianmu { diff --git a/storage/tianmu/core/rsi_cmap.cpp b/storage/tianmu/index/rsi_cmap.cpp similarity index 99% rename from storage/tianmu/core/rsi_cmap.cpp rename to storage/tianmu/index/rsi_cmap.cpp index 2f63bf4a3..8067ec32f 100644 --- a/storage/tianmu/core/rsi_cmap.cpp +++ b/storage/tianmu/index/rsi_cmap.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/rsi_cmap.h" -#include "core/pack_str.h" +#include "index/rsi_cmap.h" +#include "data/pack_str.h" #include "system/tianmu_file.h" #include "system/tianmu_system.h" #include "util/fs.h" diff --git a/storage/tianmu/core/rsi_cmap.h b/storage/tianmu/index/rsi_cmap.h similarity index 99% rename from storage/tianmu/core/rsi_cmap.h rename to storage/tianmu/index/rsi_cmap.h index b6db2efdd..e56505ff6 100644 --- a/storage/tianmu/core/rsi_cmap.h +++ b/storage/tianmu/index/rsi_cmap.h @@ -19,7 +19,7 @@ #pragma once #include "common/common_definitions.h" -#include "core/rsi_index.h" +#include "index/rsi_index.h" #include "types/tianmu_data_types.h" namespace Tianmu { diff --git a/storage/tianmu/core/rsi_histogram.cpp b/storage/tianmu/index/rsi_histogram.cpp similarity index 99% rename from storage/tianmu/core/rsi_histogram.cpp rename to storage/tianmu/index/rsi_histogram.cpp index 7ee09967f..449cf8ace 100644 --- a/storage/tianmu/core/rsi_histogram.cpp +++ b/storage/tianmu/index/rsi_histogram.cpp @@ -17,8 +17,8 @@ #include -#include "core/pack.h" -#include "core/rsi_histogram.h" +#include "data/pack.h" +#include "index/rsi_histogram.h" #include "system/tianmu_file.h" #include "system/tianmu_system.h" diff --git a/storage/tianmu/core/rsi_histogram.h b/storage/tianmu/index/rsi_histogram.h similarity index 98% rename from storage/tianmu/core/rsi_histogram.h rename to storage/tianmu/index/rsi_histogram.h index acc0b3978..480e2a572 100644 --- a/storage/tianmu/core/rsi_histogram.h +++ b/storage/tianmu/index/rsi_histogram.h @@ -19,8 +19,8 @@ #pragma once #include "common/common_definitions.h" -#include "core/pack_int.h" -#include "core/rsi_index.h" +#include "data/pack_int.h" +#include "index/rsi_index.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/rsi_index.h b/storage/tianmu/index/rsi_index.h similarity index 96% rename from storage/tianmu/core/rsi_index.h rename to storage/tianmu/index/rsi_index.h index 6c5e0b563..c411fb37f 100644 --- a/storage/tianmu/core/rsi_index.h +++ b/storage/tianmu/index/rsi_index.h @@ -19,9 +19,9 @@ #pragma once #include "common/exception.h" -#include "core/bin_tools.h" -#include "core/dpn.h" +#include "data/dpn.h" #include "mm/traceable_object.h" +#include "util/bin_tools.h" #include "util/fs.h" namespace Tianmu { diff --git a/storage/tianmu/loader/load_parser.cpp b/storage/tianmu/loader/load_parser.cpp index 1288ab042..8bd1b236b 100644 --- a/storage/tianmu/loader/load_parser.cpp +++ b/storage/tianmu/loader/load_parser.cpp @@ -19,11 +19,11 @@ #include "binlog.h" #include "core/engine.h" -#include "core/tianmu_attr.h" #include "loader/value_cache.h" #include "log_event.h" #include "system/io_parameters.h" #include "util/timer.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace loader { diff --git a/storage/tianmu/loader/parsing_strategy.cpp b/storage/tianmu/loader/parsing_strategy.cpp index c1a17e49d..8cffd7b1d 100644 --- a/storage/tianmu/loader/parsing_strategy.cpp +++ b/storage/tianmu/loader/parsing_strategy.cpp @@ -20,13 +20,13 @@ #include #include #include -#include "core/tools.h" #include "core/transaction.h" #include "item_timefunc.h" #include "loader/value_cache.h" #include "system/io_parameters.h" #include "system/tianmu_system.h" #include "types/value_parser4txt.h" +#include "util/tools.h" namespace Tianmu { namespace loader { diff --git a/storage/tianmu/loader/parsing_strategy.h b/storage/tianmu/loader/parsing_strategy.h index 1a4c37d71..8609e1caa 100644 --- a/storage/tianmu/loader/parsing_strategy.h +++ b/storage/tianmu/loader/parsing_strategy.h @@ -19,8 +19,8 @@ #pragma once #include "common/data_format.h" -#include "core/tianmu_attr_typeinfo.h" #include "loader/value_cache.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace loader { diff --git a/storage/tianmu/mm/memory_handling_policy.cpp b/storage/tianmu/mm/memory_handling_policy.cpp index bf619d8f0..cf23bdbd0 100644 --- a/storage/tianmu/mm/memory_handling_policy.cpp +++ b/storage/tianmu/mm/memory_handling_policy.cpp @@ -22,10 +22,10 @@ #include "common/assert.h" #include "common/exception.h" #include "core/data_cache.h" -#include "core/pack.h" -#include "core/tools.h" #include "core/transaction.h" +#include "data/pack.h" #include "mm/huge_heap_policy.h" +#include "util/tools.h" #include "mm/mysql_heap_policy.h" #include "mm/numa_heap_policy.h" diff --git a/storage/tianmu/mm/reference_object.h b/storage/tianmu/mm/reference_object.h index f5e88dd69..c5190416f 100644 --- a/storage/tianmu/mm/reference_object.h +++ b/storage/tianmu/mm/reference_object.h @@ -19,8 +19,8 @@ #define TIANMU_MM_REFERENCE_OBJECT_H_ #pragma once -#include "core/tools.h" #include "mm/traceable_object.h" +#include "util/tools.h" namespace Tianmu { namespace mm { diff --git a/storage/tianmu/mm/release2q.cpp b/storage/tianmu/mm/release2q.cpp index 0fb71b07e..74ce4e748 100644 --- a/storage/tianmu/mm/release2q.cpp +++ b/storage/tianmu/mm/release2q.cpp @@ -19,7 +19,7 @@ #include #include "core/data_cache.h" -#include "core/pack.h" +#include "data/pack.h" #include "mm/reference_object.h" #include "mm/release_strategy.h" #include "mm/release_tracker.h" diff --git a/storage/tianmu/mm/tcm_heap_policy.cpp b/storage/tianmu/mm/tcm_heap_policy.cpp index 0826aba89..067bc3cb4 100644 --- a/storage/tianmu/mm/tcm_heap_policy.cpp +++ b/storage/tianmu/mm/tcm_heap_policy.cpp @@ -20,8 +20,8 @@ #include #include "common/assert.h" -#include "core/tools.h" #include "tcm/span.h" +#include "util/tools.h" namespace Tianmu { namespace mm { diff --git a/storage/tianmu/mm/traceable_object.cpp b/storage/tianmu/mm/traceable_object.cpp index 731054a16..fb974e42e 100644 --- a/storage/tianmu/mm/traceable_object.cpp +++ b/storage/tianmu/mm/traceable_object.cpp @@ -19,9 +19,9 @@ #include "common/assert.h" #include "core/engine.h" -#include "core/pack.h" -#include "core/tools.h" +#include "data/pack.h" #include "mm/release_tracker.h" +#include "util/tools.h" #include "system/fet.h" #include "system/res_manager.h" diff --git a/storage/tianmu/mm/traceable_object.h b/storage/tianmu/mm/traceable_object.h index b50dc8fcd..510458199 100644 --- a/storage/tianmu/mm/traceable_object.h +++ b/storage/tianmu/mm/traceable_object.h @@ -21,8 +21,8 @@ #include #include "common/assert.h" -#include "core/tools.h" #include "mm/memory_handling_policy.h" +#include "util/tools.h" namespace Tianmu { diff --git a/storage/tianmu/core/aggregation_algorithm.cpp b/storage/tianmu/optimizer/aggregation_algorithm.cpp similarity index 99% rename from storage/tianmu/core/aggregation_algorithm.cpp rename to storage/tianmu/optimizer/aggregation_algorithm.cpp index af0e4f729..1ea4a081f 100644 --- a/storage/tianmu/core/aggregation_algorithm.cpp +++ b/storage/tianmu/optimizer/aggregation_algorithm.cpp @@ -22,12 +22,12 @@ low-level mechanisms #include "aggregation_algorithm.h" -#include "core/ctask.h" #include "core/engine.h" -#include "core/mi_iterator.h" -#include "core/pack_guardian.h" #include "core/transaction.h" +#include "data/pack_guardian.h" +#include "executor/ctask.h" #include "mm/memory_statistics.h" +#include "optimizer/iterators/mi_iterator.h" #include "system/fet.h" #include "system/tianmu_system.h" diff --git a/storage/tianmu/core/aggregation_algorithm.h b/storage/tianmu/optimizer/aggregation_algorithm.h similarity index 97% rename from storage/tianmu/core/aggregation_algorithm.h rename to storage/tianmu/optimizer/aggregation_algorithm.h index 91c760206..b6bddd03b 100644 --- a/storage/tianmu/core/aggregation_algorithm.h +++ b/storage/tianmu/optimizer/aggregation_algorithm.h @@ -19,11 +19,11 @@ #pragma once #include -#include "core/ctask.h" -#include "core/groupby_wrapper.h" -#include "core/mi_iterator.h" #include "core/query.h" #include "core/temp_table.h" +#include "executor/ctask.h" +#include "optimizer/groupby_wrapper.h" +#include "optimizer/iterators/mi_iterator.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/aggregator.h b/storage/tianmu/optimizer/aggregator.h similarity index 99% rename from storage/tianmu/core/aggregator.h rename to storage/tianmu/optimizer/aggregator.h index 5c64a7d71..17b7dc9df 100644 --- a/storage/tianmu/core/aggregator.h +++ b/storage/tianmu/optimizer/aggregator.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_AGGREGATOR_H_ #pragma once -#include "core/column.h" +#include "vc/column.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/aggregator_advanced.cpp b/storage/tianmu/optimizer/aggregator_advanced.cpp similarity index 100% rename from storage/tianmu/core/aggregator_advanced.cpp rename to storage/tianmu/optimizer/aggregator_advanced.cpp diff --git a/storage/tianmu/core/aggregator_advanced.h b/storage/tianmu/optimizer/aggregator_advanced.h similarity index 99% rename from storage/tianmu/core/aggregator_advanced.h rename to storage/tianmu/optimizer/aggregator_advanced.h index 3a1b37f34..12e74b504 100644 --- a/storage/tianmu/core/aggregator_advanced.h +++ b/storage/tianmu/optimizer/aggregator_advanced.h @@ -20,8 +20,8 @@ #include -#include "core/aggregator.h" #include "core/temp_table.h" +#include "optimizer/aggregator.h" #include "util/log_ctl.h" namespace Tianmu { diff --git a/storage/tianmu/core/aggregator_basic.cpp b/storage/tianmu/optimizer/aggregator_basic.cpp similarity index 100% rename from storage/tianmu/core/aggregator_basic.cpp rename to storage/tianmu/optimizer/aggregator_basic.cpp diff --git a/storage/tianmu/core/aggregator_basic.h b/storage/tianmu/optimizer/aggregator_basic.h similarity index 99% rename from storage/tianmu/core/aggregator_basic.h rename to storage/tianmu/optimizer/aggregator_basic.h index d82989b52..88275ee27 100644 --- a/storage/tianmu/core/aggregator_basic.h +++ b/storage/tianmu/optimizer/aggregator_basic.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_AGGREGATOR_BASIC_H_ #pragma once -#include "core/aggregator.h" +#include "optimizer/aggregator.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/compilation_tools.cpp b/storage/tianmu/optimizer/compile/compilation_tools.cpp similarity index 99% rename from storage/tianmu/core/compilation_tools.cpp rename to storage/tianmu/optimizer/compile/compilation_tools.cpp index b3a66949b..3923e2676 100644 --- a/storage/tianmu/core/compilation_tools.cpp +++ b/storage/tianmu/optimizer/compile/compilation_tools.cpp @@ -15,11 +15,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "compilation_tools.h" -#include "core/compiled_query.h" +#include "optimizer/compile/compilation_tools.h" #include "core/engine.h" #include "core/mysql_expression.h" #include "core/value_set.h" +#include "optimizer/compile/compiled_query.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/compilation_tools.h b/storage/tianmu/optimizer/compile/compilation_tools.h similarity index 100% rename from storage/tianmu/core/compilation_tools.h rename to storage/tianmu/optimizer/compile/compilation_tools.h diff --git a/storage/tianmu/core/compiled_query.cpp b/storage/tianmu/optimizer/compile/compiled_query.cpp similarity index 100% rename from storage/tianmu/core/compiled_query.cpp rename to storage/tianmu/optimizer/compile/compiled_query.cpp diff --git a/storage/tianmu/core/compiled_query.h b/storage/tianmu/optimizer/compile/compiled_query.h similarity index 99% rename from storage/tianmu/core/compiled_query.h rename to storage/tianmu/optimizer/compile/compiled_query.h index 03e8ce992..2808a6176 100644 --- a/storage/tianmu/core/compiled_query.h +++ b/storage/tianmu/optimizer/compile/compiled_query.h @@ -21,9 +21,9 @@ #include #include "common/common_definitions.h" -#include "core/cq_term.h" #include "core/just_a_table.h" #include "core/temp_table.h" +#include "optimizer/compile/cq_term.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/optimizer/compile/compiler.cpp b/storage/tianmu/optimizer/compile/compiler.cpp new file mode 100644 index 000000000..54e2a9c1d --- /dev/null +++ b/storage/tianmu/optimizer/compile/compiler.cpp @@ -0,0 +1,35 @@ +/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. + Use is subject to license terms + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +#include "optimizer/compile/compiler.h" + +namespace Tianmu { +namespace Optimizer { + +template +std::mutex CompilerF::mutex_; + +QueryPlan *Tianmu_compiler::Optimize(THD *thd, LEX *lex, Query_result *&result) { + QueryPlan *root = new QueryPlan(QueryPlanType::NONE, nullptr); + + return root; +} + +void Tianmu_compiler::Prepare(THD *thd, LEX *lex) {} + +} // namespace Optimizer +} // namespace Tianmu diff --git a/storage/tianmu/optimizer/compile/compiler.h b/storage/tianmu/optimizer/compile/compiler.h new file mode 100644 index 000000000..5bfb6886b --- /dev/null +++ b/storage/tianmu/optimizer/compile/compiler.h @@ -0,0 +1,73 @@ +/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. + Use is subject to license terms + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/** + which is used as a compiler factory to gen a compiler and to compile the query into + quer plan. +*/ +#ifndef __OPTIMIZER_COMPILER_H__ +#define __OPTIMIZER_COMPILER_H__ + +#include "core/item_tianmu_field.h" +#include "core/mysql_expression.h" +#include "optimizer/joiner.h" +#include "optimizer/plan/query_plan.h" +#include "sql/ha_my_tianmu.h" +#include "vc/column_type.h" + +namespace Tianmu { +namespace Optimizer { + +#include + +template +class CompilerF { + public: + static CompilerT &instance() { + static CompilerT instance_; + return instance_; + } + + private: + CompilerF() = default; + CompilerF(const CompilerF &) = delete; + CompilerF &operator=(const CompilerF &) = delete; + ~CompilerF() = default; + + static std::mutex mutex_; +}; + +class Compiler {}; + +class Tianmu_compiler : public Compiler { + public: + Tianmu_compiler() {} + ~Tianmu_compiler() {} + + QueryPlan *Optimize(THD *thd, LEX *lex, Query_result *&result); + + private: + // Do some basic checks and logical trnasformation on Lex tree, which is permanent. + void Prepare(THD *thd, LEX *lex); + + // IN 8.0, will use `Query_block`. + SELECT_LEX *query_stmt_; +}; + +} // namespace Optimizer +} // namespace Tianmu +#endif diff --git a/storage/tianmu/core/cq_term.cpp b/storage/tianmu/optimizer/compile/cq_term.cpp similarity index 97% rename from storage/tianmu/core/cq_term.cpp rename to storage/tianmu/optimizer/compile/cq_term.cpp index a70ae7c4c..7349a1970 100644 --- a/storage/tianmu/core/cq_term.cpp +++ b/storage/tianmu/optimizer/compile/cq_term.cpp @@ -16,12 +16,12 @@ */ #include "common/common_definitions.h" -#include "core/bin_tools.h" -#include "core/query_operator.h" -#include "core/tianmu_attr.h" #include "core/value_set.h" +#include "executor/query_operator.h" #include "system/txt_utils.h" #include "types/value_parser4txt.h" +#include "util/bin_tools.h" +#include "vc/tianmu_attr.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/cq_term.h b/storage/tianmu/optimizer/compile/cq_term.h similarity index 100% rename from storage/tianmu/core/cq_term.h rename to storage/tianmu/optimizer/compile/cq_term.h diff --git a/storage/tianmu/core/descriptor.cpp b/storage/tianmu/optimizer/compile/descriptor.cpp similarity index 99% rename from storage/tianmu/core/descriptor.cpp rename to storage/tianmu/optimizer/compile/descriptor.cpp index dcf777d26..fc9f221dd 100644 --- a/storage/tianmu/core/descriptor.cpp +++ b/storage/tianmu/optimizer/compile/descriptor.cpp @@ -17,13 +17,13 @@ #include "descriptor.h" -#include "core/compiled_query.h" -#include "core/condition_encoder.h" #include "core/parameterized_filter.h" #include "core/query.h" -#include "core/query_operator.h" #include "core/rough_value.h" #include "core/transaction.h" +#include "executor/query_operator.h" +#include "optimizer/compile/compiled_query.h" +#include "optimizer/condition_encoder.h" #include "vc/const_column.h" #include "vc/const_expr_column.h" #include "vc/expr_column.h" diff --git a/storage/tianmu/core/descriptor.h b/storage/tianmu/optimizer/compile/descriptor.h similarity index 97% rename from storage/tianmu/core/descriptor.h rename to storage/tianmu/optimizer/compile/descriptor.h index a8d73f217..ebde6a8a2 100644 --- a/storage/tianmu/core/descriptor.h +++ b/storage/tianmu/optimizer/compile/descriptor.h @@ -22,8 +22,8 @@ #include #include "common/common_definitions.h" -#include "core/cq_term.h" #include "core/dimension_group.h" +#include "optimizer/compile/cq_term.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/condition.cpp b/storage/tianmu/optimizer/condition.cpp similarity index 100% rename from storage/tianmu/core/condition.cpp rename to storage/tianmu/optimizer/condition.cpp diff --git a/storage/tianmu/core/condition.h b/storage/tianmu/optimizer/condition.h similarity index 94% rename from storage/tianmu/core/condition.h rename to storage/tianmu/optimizer/condition.h index 2465070b2..198de8092 100644 --- a/storage/tianmu/core/condition.h +++ b/storage/tianmu/optimizer/condition.h @@ -20,8 +20,8 @@ #include -#include "core/cq_term.h" -#include "core/descriptor.h" +#include "optimizer/compile/cq_term.h" +#include "optimizer/compile/descriptor.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/condition_encoder.cpp b/storage/tianmu/optimizer/condition_encoder.cpp similarity index 99% rename from storage/tianmu/core/condition_encoder.cpp rename to storage/tianmu/optimizer/condition_encoder.cpp index 04327c423..5e360c9e8 100644 --- a/storage/tianmu/core/condition_encoder.cpp +++ b/storage/tianmu/optimizer/condition_encoder.cpp @@ -16,18 +16,18 @@ */ #include "condition_encoder.h" -#include "core/cq_term.h" -#include "core/descriptor.h" #include "core/just_a_table.h" #include "core/query.h" -#include "core/tianmu_attr.h" #include "core/tianmu_table.h" #include "core/value_set.h" +#include "optimizer/compile/cq_term.h" +#include "optimizer/compile/descriptor.h" #include "vc/const_column.h" #include "vc/expr_column.h" #include "vc/in_set_column.h" #include "vc/single_column.h" #include "vc/subselect_column.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/condition_encoder.h b/storage/tianmu/optimizer/condition_encoder.h similarity index 97% rename from storage/tianmu/core/condition_encoder.h rename to storage/tianmu/optimizer/condition_encoder.h index 0f64dd428..26546d023 100644 --- a/storage/tianmu/core/condition_encoder.h +++ b/storage/tianmu/optimizer/condition_encoder.h @@ -19,8 +19,8 @@ #pragma once #include "common/common_definitions.h" -#include "core/column_type.h" -#include "core/tianmu_attr.h" +#include "vc/column_type.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/core/group_distinct_cache.cpp b/storage/tianmu/optimizer/group_distinct_cache.cpp similarity index 100% rename from storage/tianmu/core/group_distinct_cache.cpp rename to storage/tianmu/optimizer/group_distinct_cache.cpp diff --git a/storage/tianmu/core/group_distinct_cache.h b/storage/tianmu/optimizer/group_distinct_cache.h similarity index 100% rename from storage/tianmu/core/group_distinct_cache.h rename to storage/tianmu/optimizer/group_distinct_cache.h diff --git a/storage/tianmu/core/group_distinct_table.cpp b/storage/tianmu/optimizer/group_distinct_table.cpp similarity index 99% rename from storage/tianmu/core/group_distinct_table.cpp rename to storage/tianmu/optimizer/group_distinct_table.cpp index c9baea2df..dc88ab196 100644 --- a/storage/tianmu/core/group_distinct_table.cpp +++ b/storage/tianmu/optimizer/group_distinct_table.cpp @@ -17,9 +17,9 @@ #include "group_distinct_table.h" -#include "core/mi_iterator.h" #include "core/transaction.h" #include "core/value_matching_hashtable.h" +#include "optimizer/iterators/mi_iterator.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/group_distinct_table.h b/storage/tianmu/optimizer/group_distinct_table.h similarity index 98% rename from storage/tianmu/core/group_distinct_table.h rename to storage/tianmu/optimizer/group_distinct_table.h index cb9d67c56..5a7ea9c95 100644 --- a/storage/tianmu/core/group_distinct_table.h +++ b/storage/tianmu/optimizer/group_distinct_table.h @@ -18,11 +18,11 @@ #define TIANMU_CORE_GROUP_DISTINCT_TABLE_H_ #pragma once -#include "core/bin_tools.h" #include "core/blocked_mem_table.h" -#include "core/column_bin_encoder.h" -#include "core/filter.h" #include "core/value_matching_table.h" +#include "executor/filter.h" +#include "util/bin_tools.h" +#include "vc/column_bin_encoder.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/group_table.cpp b/storage/tianmu/optimizer/group_table.cpp similarity index 99% rename from storage/tianmu/core/group_table.cpp rename to storage/tianmu/optimizer/group_table.cpp index 9248d90a8..f964a25fc 100644 --- a/storage/tianmu/core/group_table.cpp +++ b/storage/tianmu/optimizer/group_table.cpp @@ -18,10 +18,10 @@ #include "group_table.h" -#include "core/group_distinct_table.h" -#include "core/mi_iterator.h" #include "core/transaction.h" #include "core/value_matching_table.h" +#include "optimizer/group_distinct_table.h" +#include "optimizer/iterators/mi_iterator.h" #include "system/fet.h" namespace Tianmu { diff --git a/storage/tianmu/core/group_table.h b/storage/tianmu/optimizer/group_table.h similarity index 97% rename from storage/tianmu/core/group_table.h rename to storage/tianmu/optimizer/group_table.h index a39a07544..233114be6 100644 --- a/storage/tianmu/core/group_table.h +++ b/storage/tianmu/optimizer/group_table.h @@ -18,15 +18,15 @@ #define TIANMU_CORE_GROUP_TABLE_H_ #pragma once -#include "core/aggregator_advanced.h" -#include "core/aggregator_basic.h" -#include "core/bin_tools.h" -#include "core/column_bin_encoder.h" -#include "core/filter.h" -#include "core/group_distinct_cache.h" -#include "core/group_distinct_table.h" #include "core/temp_table.h" #include "core/value_matching_table.h" +#include "executor/filter.h" +#include "optimizer/aggregator_advanced.h" +#include "optimizer/aggregator_basic.h" +#include "optimizer/group_distinct_cache.h" +#include "optimizer/group_distinct_table.h" +#include "util/bin_tools.h" +#include "vc/column_bin_encoder.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/groupby_wrapper.cpp b/storage/tianmu/optimizer/groupby_wrapper.cpp similarity index 99% rename from storage/tianmu/core/groupby_wrapper.cpp rename to storage/tianmu/optimizer/groupby_wrapper.cpp index 241818764..6920cf1e5 100644 --- a/storage/tianmu/core/groupby_wrapper.cpp +++ b/storage/tianmu/optimizer/groupby_wrapper.cpp @@ -17,7 +17,7 @@ #include "groupby_wrapper.h" -#include "core/tianmu_attr.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/groupby_wrapper.h b/storage/tianmu/optimizer/groupby_wrapper.h similarity index 98% rename from storage/tianmu/core/groupby_wrapper.h rename to storage/tianmu/optimizer/groupby_wrapper.h index 3bf5c5c0b..2d0ad64cf 100644 --- a/storage/tianmu/core/groupby_wrapper.h +++ b/storage/tianmu/optimizer/groupby_wrapper.h @@ -18,12 +18,12 @@ #define TIANMU_CORE_GROUPBY_WRAPPER_H_ #pragma once -#include "core/group_distinct_cache.h" -#include "core/group_table.h" -#include "core/pack_guardian.h" #include "core/temp_table.h" -#include "core/tools.h" +#include "data/pack_guardian.h" +#include "optimizer/group_distinct_cache.h" +#include "optimizer/group_table.h" #include "system/tianmu_system.h" +#include "util/tools.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/mi_iterator.cpp b/storage/tianmu/optimizer/iterators/mi_iterator.cpp similarity index 99% rename from storage/tianmu/core/mi_iterator.cpp rename to storage/tianmu/optimizer/iterators/mi_iterator.cpp index b5fe3a7dd..f630159e6 100644 --- a/storage/tianmu/core/mi_iterator.cpp +++ b/storage/tianmu/optimizer/iterators/mi_iterator.cpp @@ -17,7 +17,7 @@ #include "mi_iterator.h" -#include "core/pack_orderer.h" +#include "data/pack_orderer.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/mi_iterator.h b/storage/tianmu/optimizer/iterators/mi_iterator.h similarity index 99% rename from storage/tianmu/core/mi_iterator.h rename to storage/tianmu/optimizer/iterators/mi_iterator.h index 28fbff95b..688a67d87 100644 --- a/storage/tianmu/core/mi_iterator.h +++ b/storage/tianmu/optimizer/iterators/mi_iterator.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_MI_ITERATOR_H_ #pragma once -#include "core/multi_index.h" +#include "index/multi_index.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/mi_step_iterator.cpp b/storage/tianmu/optimizer/iterators/mi_step_iterator.cpp similarity index 100% rename from storage/tianmu/core/mi_step_iterator.cpp rename to storage/tianmu/optimizer/iterators/mi_step_iterator.cpp diff --git a/storage/tianmu/core/mi_step_iterator.h b/storage/tianmu/optimizer/iterators/mi_step_iterator.h similarity index 94% rename from storage/tianmu/core/mi_step_iterator.h rename to storage/tianmu/optimizer/iterators/mi_step_iterator.h index 68594bc91..a5ff1aa72 100644 --- a/storage/tianmu/core/mi_step_iterator.h +++ b/storage/tianmu/optimizer/iterators/mi_step_iterator.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_MI_STEP_ITERATOR_H_ #pragma once -#include "core/mi_iterator.h" +#include "optimizer/iterators/mi_iterator.h" namespace Tianmu { namespace core { @@ -54,4 +54,4 @@ class MIRowsStepIterator : public MIIterator { } // namespace core } // namespace Tianmu -#endif // TIANMU_CORE_MI_STEP_ITERATOR_H_ \ No newline at end of file +#endif // TIANMU_CORE_MI_STEP_ITERATOR_H_ diff --git a/storage/tianmu/core/mi_updating_iterator.cpp b/storage/tianmu/optimizer/iterators/mi_updating_iterator.cpp similarity index 100% rename from storage/tianmu/core/mi_updating_iterator.cpp rename to storage/tianmu/optimizer/iterators/mi_updating_iterator.cpp diff --git a/storage/tianmu/core/mi_updating_iterator.h b/storage/tianmu/optimizer/iterators/mi_updating_iterator.h similarity index 99% rename from storage/tianmu/core/mi_updating_iterator.h rename to storage/tianmu/optimizer/iterators/mi_updating_iterator.h index 148ac3735..23fda8cf5 100644 --- a/storage/tianmu/core/mi_updating_iterator.h +++ b/storage/tianmu/optimizer/iterators/mi_updating_iterator.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_MI_UPDATING_ITERATOR_H_ #pragma once -#include "core/mi_iterator.h" +#include "optimizer/iterators/mi_iterator.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/joiner.cpp b/storage/tianmu/optimizer/joiner.cpp similarity index 94% rename from storage/tianmu/core/joiner.cpp rename to storage/tianmu/optimizer/joiner.cpp index 70787e16c..e89902bc2 100644 --- a/storage/tianmu/core/joiner.cpp +++ b/storage/tianmu/optimizer/joiner.cpp @@ -15,13 +15,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "joiner.h" +#include "optimizer/joiner.h" -#include "core/joiner_hash.h" -#include "core/joiner_mapped.h" -#include "core/joiner_sort.h" #include "core/parallel_hash_join.h" #include "core/query.h" +#include "optimizer/joiner_hash.h" +#include "optimizer/joiner_mapped.h" +#include "optimizer/joiner_sort.h" #include "vc/const_column.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/core/joiner.h b/storage/tianmu/optimizer/joiner.h similarity index 97% rename from storage/tianmu/core/joiner.h rename to storage/tianmu/optimizer/joiner.h index d104c684b..50048aeb8 100644 --- a/storage/tianmu/core/joiner.h +++ b/storage/tianmu/optimizer/joiner.h @@ -18,10 +18,10 @@ #define TIANMU_CORE_JOINER_H_ #pragma once -#include "core/condition.h" -#include "core/ctask.h" -#include "core/descriptor.h" -#include "core/mi_iterator.h" +#include "executor/ctask.h" +#include "optimizer/compile/descriptor.h" +#include "optimizer/condition.h" +#include "optimizer/iterators/mi_iterator.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/joiner_general.cpp b/storage/tianmu/optimizer/joiner_general.cpp similarity index 98% rename from storage/tianmu/core/joiner_general.cpp rename to storage/tianmu/optimizer/joiner_general.cpp index 247807818..7198e94bb 100644 --- a/storage/tianmu/core/joiner_general.cpp +++ b/storage/tianmu/optimizer/joiner_general.cpp @@ -15,12 +15,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "core/ctask.h" -#include "core/descriptor.h" -#include "core/joiner.h" -#include "core/mi_new_contents.h" -#include "core/mi_updating_iterator.h" #include "core/transaction.h" +#include "executor/ctask.h" +#include "index/mi_new_contents.h" +#include "optimizer/compile/descriptor.h" +#include "optimizer/iterators/mi_updating_iterator.h" +#include "optimizer/joiner.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/joiner_hash.cpp b/storage/tianmu/optimizer/joiner_hash.cpp similarity index 99% rename from storage/tianmu/core/joiner_hash.cpp rename to storage/tianmu/optimizer/joiner_hash.cpp index 7b1203ee9..b015c8b9c 100644 --- a/storage/tianmu/core/joiner_hash.cpp +++ b/storage/tianmu/optimizer/joiner_hash.cpp @@ -19,11 +19,11 @@ #include "common/assert.h" #include "core/engine.h" -#include "core/join_thread_table.h" -#include "core/mi_new_contents.h" -#include "core/rough_multi_index.h" #include "core/temp_table.h" #include "core/transaction.h" +#include "executor/join_thread_table.h" +#include "index/mi_new_contents.h" +#include "index/rough_multi_index.h" #include "system/fet.h" #include "util/thread_pool.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/core/joiner_hash.h b/storage/tianmu/optimizer/joiner_hash.h similarity index 98% rename from storage/tianmu/core/joiner_hash.h rename to storage/tianmu/optimizer/joiner_hash.h index 9c68cf296..45a837cb8 100644 --- a/storage/tianmu/core/joiner_hash.h +++ b/storage/tianmu/optimizer/joiner_hash.h @@ -18,8 +18,8 @@ #define TIANMU_CORE_JOINER_HASH_H_ #pragma once -#include "core/joiner.h" -#include "core/joiner_hash_table.h" +#include "optimizer/joiner.h" +#include "optimizer/joiner_hash_table.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/joiner_hash_table.cpp b/storage/tianmu/optimizer/joiner_hash_table.cpp similarity index 99% rename from storage/tianmu/core/joiner_hash_table.cpp rename to storage/tianmu/optimizer/joiner_hash_table.cpp index 224d05d6f..2ca5596db 100644 --- a/storage/tianmu/core/joiner_hash_table.cpp +++ b/storage/tianmu/optimizer/joiner_hash_table.cpp @@ -17,8 +17,8 @@ #include "joiner_hash_table.h" -#include "core/tools.h" #include "core/transaction.h" +#include "util/tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/joiner_hash_table.h b/storage/tianmu/optimizer/joiner_hash_table.h similarity index 98% rename from storage/tianmu/core/joiner_hash_table.h rename to storage/tianmu/optimizer/joiner_hash_table.h index 5675a4c0b..f1f9bb511 100644 --- a/storage/tianmu/core/joiner_hash_table.h +++ b/storage/tianmu/optimizer/joiner_hash_table.h @@ -18,11 +18,11 @@ #define TIANMU_CORE_JOINER_HASH_TABLE_H_ #pragma once -#include "core/bin_tools.h" -#include "core/column_bin_encoder.h" -#include "core/filter.h" -#include "core/tianmu_attr_typeinfo.h" +#include "executor/filter.h" #include "mm/traceable_object.h" +#include "util/bin_tools.h" +#include "vc/column_bin_encoder.h" +#include "vc/tianmu_attr_typeinfo.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/joiner_mapped.cpp b/storage/tianmu/optimizer/joiner_mapped.cpp similarity index 99% rename from storage/tianmu/core/joiner_mapped.cpp rename to storage/tianmu/optimizer/joiner_mapped.cpp index a522ae46d..3af11ebcd 100644 --- a/storage/tianmu/core/joiner_mapped.cpp +++ b/storage/tianmu/optimizer/joiner_mapped.cpp @@ -18,10 +18,10 @@ #include "joiner_mapped.h" #include "common/common_definitions.h" -#include "core/ctask.h" #include "core/engine.h" -#include "core/mi_new_contents.h" #include "core/transaction.h" +#include "executor/ctask.h" +#include "index/mi_new_contents.h" #include "util/log_ctl.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/core/joiner_mapped.h b/storage/tianmu/optimizer/joiner_mapped.h similarity index 98% rename from storage/tianmu/core/joiner_mapped.h rename to storage/tianmu/optimizer/joiner_mapped.h index df753421d..7367b45b4 100644 --- a/storage/tianmu/core/joiner_mapped.h +++ b/storage/tianmu/optimizer/joiner_mapped.h @@ -21,9 +21,9 @@ #include #include -#include "core/ctask.h" -#include "core/joiner.h" -#include "core/multi_index_builder.h" +#include "executor/ctask.h" +#include "index/multi_index_builder.h" +#include "optimizer/joiner.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/joiner_sort.cpp b/storage/tianmu/optimizer/joiner_sort.cpp similarity index 99% rename from storage/tianmu/core/joiner_sort.cpp rename to storage/tianmu/optimizer/joiner_sort.cpp index 776a2bcfc..ade1a26e9 100644 --- a/storage/tianmu/core/joiner_sort.cpp +++ b/storage/tianmu/optimizer/joiner_sort.cpp @@ -17,10 +17,10 @@ #include -#include "core/joiner_sort.h" -#include "core/mi_new_contents.h" -#include "core/sorter3.h" #include "core/transaction.h" +#include "index/mi_new_contents.h" +#include "optimizer/joiner_sort.h" +#include "util/sorter3.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/joiner_sort.h b/storage/tianmu/optimizer/joiner_sort.h similarity index 99% rename from storage/tianmu/core/joiner_sort.h rename to storage/tianmu/optimizer/joiner_sort.h index 3b57e20fb..c1dd79047 100644 --- a/storage/tianmu/core/joiner_sort.h +++ b/storage/tianmu/optimizer/joiner_sort.h @@ -18,10 +18,10 @@ #define TIANMU_CORE_JOINER_SORT_H_ #pragma once -#include "core/column_bin_encoder.h" -#include "core/joiner.h" #include "mm/traceable_object.h" +#include "optimizer/joiner.h" #include "system/cacheable_item.h" +#include "vc/column_bin_encoder.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/optimizer/plan/query_plan.h b/storage/tianmu/optimizer/plan/query_plan.h new file mode 100644 index 000000000..9365f5d40 --- /dev/null +++ b/storage/tianmu/optimizer/plan/query_plan.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. + Use is subject to license terms + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +// this is base class of query plan used for tianmu engine. +// why we do this? due to it's hard to do optimization and pipeline execution on +// this current codes and framework. Therefore, we should split the optimization +// into stages, such as, prepare, setup, prepare, transformation,optimization, +// query plan gen, execution. just like the other sql engines do. + +#ifndef __OPTIMIZER_QUERY_PLAN__ +#define __OPTIMIZER_QUERY_PLAN__ + +#include "optimizer/compile/cq_term.h" + +namespace Tianmu { +namespace Optimizer { + +// in future we will change ns `core` to `optimizer`. +using namespace core; + +enum class QueryPlanType { NONE = 0, TABLE_SCAN, JOIN, AGG }; + +// the basic plan +class QueryPlan { + public: + QueryPlan(QueryPlanType type, QueryPlan *parent) { + type_ = type; + parent_ = parent; + } + virtual ~QueryPlan() = default; + + private: + // type of query plan. + QueryPlanType type_{QueryPlanType::NONE}; + + // parent of this plan. + QueryPlan *parent_; +}; + +class TableScan : public QueryPlan { + public: + TableScan() : QueryPlan(QueryPlanType::TABLE_SCAN, nullptr) {} + TableScan(QueryPlan *parent) : QueryPlan(QueryPlanType::TABLE_SCAN, parent) {} + + ~TableScan() {} + + public: + enum class ScanType { SEQ_SCAN = 0, INDX_SCAN }; + + private: + QueryPlan *parent_; + ScanType scan_type_; + TabID tid_; +}; + +class Join : public QueryPlan {}; + +class Aggregation : public QueryPlan {}; + +} // namespace Optimizer +} // namespace Tianmu + +#endif diff --git a/storage/tianmu/handler/ha_my_tianmu.cpp b/storage/tianmu/sql/ha_my_tianmu.cpp similarity index 99% rename from storage/tianmu/handler/ha_my_tianmu.cpp rename to storage/tianmu/sql/ha_my_tianmu.cpp index bc59b5380..7787dcf1f 100644 --- a/storage/tianmu/handler/ha_my_tianmu.cpp +++ b/storage/tianmu/sql/ha_my_tianmu.cpp @@ -16,8 +16,8 @@ */ #include "common/mysql_gate.h" -#include "core/compilation_tools.h" #include "core/engine.h" +#include "optimizer/compile/compilation_tools.h" #include "system/configuration.h" #include "util/log_ctl.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/handler/ha_my_tianmu.h b/storage/tianmu/sql/ha_my_tianmu.h similarity index 100% rename from storage/tianmu/handler/ha_my_tianmu.h rename to storage/tianmu/sql/ha_my_tianmu.h diff --git a/storage/tianmu/system/cacheable_item.cpp b/storage/tianmu/system/cacheable_item.cpp index 0b5f665f1..82174b3da 100644 --- a/storage/tianmu/system/cacheable_item.cpp +++ b/storage/tianmu/system/cacheable_item.cpp @@ -17,9 +17,9 @@ #include "cacheable_item.h" -#include "core/tools.h" #include "system/fet.h" #include "system/tianmu_system.h" +#include "util/tools.h" namespace Tianmu { namespace system { diff --git a/storage/tianmu/system/channel.cpp b/storage/tianmu/system/channel.cpp index a6b564254..1dc0d1c99 100644 --- a/storage/tianmu/system/channel.cpp +++ b/storage/tianmu/system/channel.cpp @@ -20,8 +20,8 @@ #include #include "channel.h" -#include "core/tools.h" #include "system/tianmu_system.h" +#include "util/tools.h" namespace Tianmu { namespace system { diff --git a/storage/tianmu/system/fet.h b/storage/tianmu/system/fet.h index 144065308..7111afc56 100644 --- a/storage/tianmu/system/fet.h +++ b/storage/tianmu/system/fet.h @@ -20,8 +20,8 @@ #include -#include "core/tools.h" #include "system/tianmu_system.h" +#include "util/tools.h" namespace Tianmu { namespace system { diff --git a/storage/tianmu/system/io_parameters.h b/storage/tianmu/system/io_parameters.h index effe8ce7b..89dcb55fa 100644 --- a/storage/tianmu/system/io_parameters.h +++ b/storage/tianmu/system/io_parameters.h @@ -23,8 +23,8 @@ #include "common/assert.h" #include "common/common_definitions.h" #include "common/data_format.h" -#include "core/tianmu_attr_typeinfo.h" #include "system/file_system.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace system { diff --git a/storage/tianmu/system/large_buffer.cpp b/storage/tianmu/system/large_buffer.cpp index 2cbc67301..ad5158ccf 100644 --- a/storage/tianmu/system/large_buffer.cpp +++ b/storage/tianmu/system/large_buffer.cpp @@ -20,10 +20,10 @@ #include #include "common/assert.h" -#include "core/tools.h" #include "system/io_parameters.h" #include "system/tianmu_file.h" #include "system/tianmu_system.h" +#include "util/tools.h" namespace Tianmu { namespace system { diff --git a/storage/tianmu/system/tianmu_system.cpp b/storage/tianmu/system/tianmu_system.cpp index d94131713..1a2367bda 100644 --- a/storage/tianmu/system/tianmu_system.cpp +++ b/storage/tianmu/system/tianmu_system.cpp @@ -19,8 +19,8 @@ #include -#include "core/tools.h" #include "system/fet.h" +#include "util/tools.h" namespace Tianmu { diff --git a/storage/tianmu/types/bstring.cpp b/storage/tianmu/types/bstring.cpp index 07b1dce7b..fa6fb7fb1 100644 --- a/storage/tianmu/types/bstring.cpp +++ b/storage/tianmu/types/bstring.cpp @@ -17,7 +17,7 @@ #include "types/tianmu_data_types.h" #include "common/assert.h" -#include "core/tools.h" +#include "util/tools.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/data_type.cpp b/storage/tianmu/types/data_type.cpp similarity index 99% rename from storage/tianmu/core/data_type.cpp rename to storage/tianmu/types/data_type.cpp index e79714f92..25a5a6c8b 100644 --- a/storage/tianmu/core/data_type.cpp +++ b/storage/tianmu/types/data_type.cpp @@ -18,8 +18,8 @@ #include "data_type.h" #include "common/assert.h" -#include "core/column_type.h" #include "core/quick_math.h" +#include "vc/column_type.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/data_type.h b/storage/tianmu/types/data_type.h similarity index 100% rename from storage/tianmu/core/data_type.h rename to storage/tianmu/types/data_type.h diff --git a/storage/tianmu/types/tianmu_data_types.cpp b/storage/tianmu/types/tianmu_data_types.cpp index 063424e4e..0753663a9 100644 --- a/storage/tianmu/types/tianmu_data_types.cpp +++ b/storage/tianmu/types/tianmu_data_types.cpp @@ -17,8 +17,8 @@ #include "tianmu_data_types.h" -#include "core/tianmu_attr.h" -#include "core/tianmu_attr_typeinfo.h" +#include "vc/tianmu_attr.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace types { diff --git a/storage/tianmu/types/tianmu_data_types.h b/storage/tianmu/types/tianmu_data_types.h index b0ab9957e..04978853c 100644 --- a/storage/tianmu/types/tianmu_data_types.h +++ b/storage/tianmu/types/tianmu_data_types.h @@ -24,9 +24,9 @@ #include "common/assert.h" #include "common/common_definitions.h" #include "common/exception.h" -#include "core/bin_tools.h" -#include "core/tianmu_attr_typeinfo.h" #include "system/txt_utils.h" +#include "util/bin_tools.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace types { diff --git a/storage/tianmu/types/tianmu_datetime.cpp b/storage/tianmu/types/tianmu_datetime.cpp index 3c35538cd..d131b4ed9 100644 --- a/storage/tianmu/types/tianmu_datetime.cpp +++ b/storage/tianmu/types/tianmu_datetime.cpp @@ -18,10 +18,10 @@ #include "types/tianmu_data_types.h" #include "core/engine.h" -#include "core/tools.h" #include "core/transaction.h" #include "system/tianmu_system.h" #include "types/value_parser4txt.h" +#include "util/tools.h" namespace Tianmu { namespace types { diff --git a/storage/tianmu/types/tianmu_num.cpp b/storage/tianmu/types/tianmu_num.cpp index 33d240964..a044a1aae 100644 --- a/storage/tianmu/types/tianmu_num.cpp +++ b/storage/tianmu/types/tianmu_num.cpp @@ -20,10 +20,10 @@ #include #include "common/assert.h" -#include "core/tools.h" #include "system/txt_utils.h" #include "types/tianmu_data_types.h" #include "types/value_parser4txt.h" +#include "util/tools.h" namespace Tianmu { namespace types { diff --git a/storage/tianmu/types/value_parser4txt.h b/storage/tianmu/types/value_parser4txt.h index 80aa31d19..556fcf678 100644 --- a/storage/tianmu/types/value_parser4txt.h +++ b/storage/tianmu/types/value_parser4txt.h @@ -20,8 +20,8 @@ #include "common/assert.h" #include "common/exception.h" -#include "core/tianmu_attr_typeinfo.h" #include "types/tianmu_data_types.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace types { diff --git a/storage/tianmu/core/bin_tools.cpp b/storage/tianmu/util/bin_tools.cpp similarity index 99% rename from storage/tianmu/core/bin_tools.cpp rename to storage/tianmu/util/bin_tools.cpp index 98e4ecfac..0a513fe6e 100644 --- a/storage/tianmu/core/bin_tools.cpp +++ b/storage/tianmu/util/bin_tools.cpp @@ -17,8 +17,8 @@ #include -#include "core/bin_tools.h" #include "system/tianmu_system.h" +#include "util/bin_tools.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/bin_tools.h b/storage/tianmu/util/bin_tools.h similarity index 100% rename from storage/tianmu/core/bin_tools.h rename to storage/tianmu/util/bin_tools.h diff --git a/storage/tianmu/core/sorter3.cpp b/storage/tianmu/util/sorter3.cpp similarity index 99% rename from storage/tianmu/core/sorter3.cpp rename to storage/tianmu/util/sorter3.cpp index 7500394db..abee68ed9 100644 --- a/storage/tianmu/core/sorter3.cpp +++ b/storage/tianmu/util/sorter3.cpp @@ -17,12 +17,12 @@ #include #include "common/common_definitions.h" -#include "core/bin_tools.h" -#include "core/tools.h" #include "core/transaction.h" #include "sorter3.h" #include "system/fet.h" #include "system/tianmu_system.h" +#include "util/bin_tools.h" +#include "util/tools.h" namespace Tianmu { namespace core { @@ -518,4 +518,4 @@ bool SorterLimit::PutValue(Sorter3 *s) { return true; } } // namespace core -} // namespace Tianmu \ No newline at end of file +} // namespace Tianmu diff --git a/storage/tianmu/core/sorter3.h b/storage/tianmu/util/sorter3.h similarity index 100% rename from storage/tianmu/core/sorter3.h rename to storage/tianmu/util/sorter3.h diff --git a/storage/tianmu/core/sorter_wrapper.cpp b/storage/tianmu/util/sorter_wrapper.cpp similarity index 99% rename from storage/tianmu/core/sorter_wrapper.cpp rename to storage/tianmu/util/sorter_wrapper.cpp index 81b2ecdb9..692b3c8ba 100644 --- a/storage/tianmu/core/sorter_wrapper.cpp +++ b/storage/tianmu/util/sorter_wrapper.cpp @@ -17,9 +17,9 @@ #include "sorter_wrapper.h" #include "core/engine.h" -#include "core/mi_iterator.h" -#include "core/pack_orderer.h" #include "core/transaction.h" +#include "data/pack_orderer.h" +#include "optimizer/iterators/mi_iterator.h" #include "util/thread_pool.h" namespace Tianmu { diff --git a/storage/tianmu/core/sorter_wrapper.h b/storage/tianmu/util/sorter_wrapper.h similarity index 96% rename from storage/tianmu/core/sorter_wrapper.h rename to storage/tianmu/util/sorter_wrapper.h index c92142d39..fdd0c8192 100644 --- a/storage/tianmu/core/sorter_wrapper.h +++ b/storage/tianmu/util/sorter_wrapper.h @@ -18,10 +18,10 @@ #define TIANMU_CORE_SORTER_WRAPPER_H_ #pragma once -#include "core/column_bin_encoder.h" -#include "core/mi_iterator.h" -#include "core/multi_index.h" -#include "core/sorter3.h" +#include "index/multi_index.h" +#include "optimizer/iterators/mi_iterator.h" +#include "util/sorter3.h" +#include "vc/column_bin_encoder.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/tools.h b/storage/tianmu/util/tools.h similarity index 100% rename from storage/tianmu/core/tools.h rename to storage/tianmu/util/tools.h diff --git a/storage/tianmu/core/column.h b/storage/tianmu/vc/column.h similarity index 98% rename from storage/tianmu/core/column.h rename to storage/tianmu/vc/column.h index b63b2f355..bbeb30d23 100644 --- a/storage/tianmu/core/column.h +++ b/storage/tianmu/vc/column.h @@ -19,8 +19,8 @@ #pragma once #include "common/common_definitions.h" -#include "core/column_type.h" #include "types/tianmu_data_types.h" +#include "vc/column_type.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/column_bin_encoder.cpp b/storage/tianmu/vc/column_bin_encoder.cpp similarity index 99% rename from storage/tianmu/core/column_bin_encoder.cpp rename to storage/tianmu/vc/column_bin_encoder.cpp index 71cbfe045..f692615cd 100644 --- a/storage/tianmu/core/column_bin_encoder.cpp +++ b/storage/tianmu/vc/column_bin_encoder.cpp @@ -16,9 +16,9 @@ */ #include "column_bin_encoder.h" -#include "core/bin_tools.h" -#include "core/mi_iterator.h" #include "core/transaction.h" +#include "optimizer/iterators/mi_iterator.h" +#include "util/bin_tools.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/column_bin_encoder.h b/storage/tianmu/vc/column_bin_encoder.h similarity index 99% rename from storage/tianmu/core/column_bin_encoder.h rename to storage/tianmu/vc/column_bin_encoder.h index 0cc7cd5d5..656aa2851 100644 --- a/storage/tianmu/core/column_bin_encoder.h +++ b/storage/tianmu/vc/column_bin_encoder.h @@ -18,7 +18,7 @@ #define TIANMU_CORE_COLUMN_BIN_ENCODER_H_ #pragma once -#include "core/rsi_cmap.h" +#include "index/rsi_cmap.h" #include "types/text_stat.h" #include "vc/virtual_column.h" @@ -506,4 +506,4 @@ class MultiindexPositionEncoder { } // namespace core } // namespace Tianmu -#endif // TIANMU_CORE_COLUMN_BIN_ENCODER_H_ \ No newline at end of file +#endif // TIANMU_CORE_COLUMN_BIN_ENCODER_H_ diff --git a/storage/tianmu/core/column_share.cpp b/storage/tianmu/vc/column_share.cpp similarity index 99% rename from storage/tianmu/core/column_share.cpp rename to storage/tianmu/vc/column_share.cpp index 2bfc8cde2..af779f312 100644 --- a/storage/tianmu/core/column_share.cpp +++ b/storage/tianmu/vc/column_share.cpp @@ -20,10 +20,10 @@ #include #include "common/exception.h" -#include "core/column_share.h" #include "core/engine.h" #include "system/tianmu_file.h" #include "system/tianmu_system.h" +#include "vc/column_share.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/column_share.h b/storage/tianmu/vc/column_share.h similarity index 98% rename from storage/tianmu/core/column_share.h rename to storage/tianmu/vc/column_share.h index b0bdf3a6e..bb05c7f40 100644 --- a/storage/tianmu/core/column_share.h +++ b/storage/tianmu/vc/column_share.h @@ -23,9 +23,9 @@ #include "common/assert.h" #include "common/common_definitions.h" #include "common/mysql_gate.h" -#include "core/column_type.h" -#include "core/dpn.h" +#include "data/dpn.h" #include "util/fs.h" +#include "vc/column_type.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/column_type.cpp b/storage/tianmu/vc/column_type.cpp similarity index 97% rename from storage/tianmu/core/column_type.cpp rename to storage/tianmu/vc/column_type.cpp index 906255d58..b9c0aedc3 100644 --- a/storage/tianmu/core/column_type.cpp +++ b/storage/tianmu/vc/column_type.cpp @@ -17,9 +17,9 @@ #include -#include "core/column_type.h" -#include "core/data_type.h" #include "core/quick_math.h" +#include "types/data_type.h" +#include "vc/column_type.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/column_type.h b/storage/tianmu/vc/column_type.h similarity index 99% rename from storage/tianmu/core/column_type.h rename to storage/tianmu/vc/column_type.h index 4607bf94a..159083883 100644 --- a/storage/tianmu/core/column_type.h +++ b/storage/tianmu/vc/column_type.h @@ -19,7 +19,7 @@ #pragma once #include "common/common_definitions.h" -#include "core/tianmu_attr_typeinfo.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/vc/const_column.cpp b/storage/tianmu/vc/const_column.cpp index 58444189f..a370cb93e 100644 --- a/storage/tianmu/vc/const_column.cpp +++ b/storage/tianmu/vc/const_column.cpp @@ -17,10 +17,10 @@ #include "const_column.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" #include "core/transaction.h" +#include "optimizer/compile/compiled_query.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/const_column.h b/storage/tianmu/vc/const_column.h index 2b8a8c4ea..1b9e2c40b 100644 --- a/storage/tianmu/vc/const_column.h +++ b/storage/tianmu/vc/const_column.h @@ -18,8 +18,8 @@ #define TIANMU_VC_CONST_COLUMN_H_ #pragma once -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/vc/const_expr_column.cpp b/storage/tianmu/vc/const_expr_column.cpp index 3b09a18e1..2002e5e5c 100644 --- a/storage/tianmu/vc/const_expr_column.cpp +++ b/storage/tianmu/vc/const_expr_column.cpp @@ -17,9 +17,9 @@ #include "const_expr_column.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" +#include "optimizer/compile/compiled_query.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/const_expr_column.h b/storage/tianmu/vc/const_expr_column.h index 311b9b031..5ccb96396 100644 --- a/storage/tianmu/vc/const_expr_column.h +++ b/storage/tianmu/vc/const_expr_column.h @@ -18,8 +18,8 @@ #define TIANMU_VC_CONST_EXPR_COLUMN_H_ #pragma once -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "vc/expr_column.h" namespace Tianmu { diff --git a/storage/tianmu/vc/expr_column.cpp b/storage/tianmu/vc/expr_column.cpp index 290870c6b..cf6e6183e 100644 --- a/storage/tianmu/vc/expr_column.cpp +++ b/storage/tianmu/vc/expr_column.cpp @@ -16,9 +16,9 @@ */ #include "expr_column.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" +#include "optimizer/compile/compiled_query.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/expr_column.h b/storage/tianmu/vc/expr_column.h index 834e93809..14e617813 100644 --- a/storage/tianmu/vc/expr_column.h +++ b/storage/tianmu/vc/expr_column.h @@ -20,8 +20,8 @@ #include -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/vc/in_set_column.cpp b/storage/tianmu/vc/in_set_column.cpp index 04605fc96..b9ce999ac 100644 --- a/storage/tianmu/vc/in_set_column.cpp +++ b/storage/tianmu/vc/in_set_column.cpp @@ -17,11 +17,11 @@ #include "in_set_column.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" +#include "optimizer/compile/compiled_query.h" #include "vc/const_column.h" #include "vc/expr_column.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/in_set_column.h b/storage/tianmu/vc/in_set_column.h index d68c42e7c..e9b68e5ab 100644 --- a/storage/tianmu/vc/in_set_column.h +++ b/storage/tianmu/vc/in_set_column.h @@ -18,10 +18,10 @@ #define TIANMU_VC_IN_SET_COLUMN_H_ #pragma once -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" #include "core/temp_table.h" #include "core/value_set.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "vc/multi_value_column.h" namespace Tianmu { diff --git a/storage/tianmu/vc/multi_value_column.h b/storage/tianmu/vc/multi_value_column.h index 847a89a1d..f9648e703 100644 --- a/storage/tianmu/vc/multi_value_column.h +++ b/storage/tianmu/vc/multi_value_column.h @@ -18,8 +18,8 @@ #define TIANMU_VC_MULTI_VALUE_COLUMN_H_ #pragma once -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "types/tianmu_num.h" #include "vc/virtual_column.h" diff --git a/storage/tianmu/core/physical_column.h b/storage/tianmu/vc/physical_column.h similarity index 99% rename from storage/tianmu/core/physical_column.h rename to storage/tianmu/vc/physical_column.h index 9955f0eff..de22efb6f 100644 --- a/storage/tianmu/core/physical_column.h +++ b/storage/tianmu/vc/physical_column.h @@ -18,10 +18,10 @@ #define TIANMU_CORE_PHYSICAL_COLUMN_H_ #pragma once -#include "core/column.h" -#include "core/descriptor.h" #include "core/mysql_expression.h" +#include "optimizer/compile/descriptor.h" #include "types/text_stat.h" +#include "vc/column.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/vc/single_column.cpp b/storage/tianmu/vc/single_column.cpp index ddeb9f467..d393815be 100644 --- a/storage/tianmu/vc/single_column.cpp +++ b/storage/tianmu/vc/single_column.cpp @@ -17,9 +17,9 @@ #include "single_column.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" +#include "optimizer/compile/compiled_query.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/single_column.h b/storage/tianmu/vc/single_column.h index 83718ddcb..a248b2359 100644 --- a/storage/tianmu/vc/single_column.h +++ b/storage/tianmu/vc/single_column.h @@ -18,9 +18,9 @@ #define TIANMU_VC_SINGLE_COLUMN_H_ #pragma once -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" -#include "core/physical_column.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" +#include "vc/physical_column.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/vc/subselect_column.cpp b/storage/tianmu/vc/subselect_column.cpp index b33109019..a30d98035 100644 --- a/storage/tianmu/vc/subselect_column.cpp +++ b/storage/tianmu/vc/subselect_column.cpp @@ -17,11 +17,11 @@ #include "subselect_column.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" #include "core/value_set.h" +#include "optimizer/compile/compiled_query.h" #include "vc/const_column.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/subselect_column.h b/storage/tianmu/vc/subselect_column.h index cbea17c8a..87e75ec29 100644 --- a/storage/tianmu/vc/subselect_column.h +++ b/storage/tianmu/vc/subselect_column.h @@ -18,10 +18,10 @@ #define TIANMU_VC_SUBSELECT_COLUMN_H_ #pragma once -#include "core/mi_updating_iterator.h" -#include "core/pack_guardian.h" #include "core/rough_value.h" #include "core/temp_table.h" +#include "data/pack_guardian.h" +#include "optimizer/iterators/mi_updating_iterator.h" #include "vc/multi_value_column.h" namespace Tianmu { diff --git a/storage/tianmu/core/tianmu_attr.cpp b/storage/tianmu/vc/tianmu_attr.cpp similarity index 99% rename from storage/tianmu/core/tianmu_attr.cpp rename to storage/tianmu/vc/tianmu_attr.cpp index 91121de71..1e1088f88 100644 --- a/storage/tianmu/core/tianmu_attr.cpp +++ b/storage/tianmu/vc/tianmu_attr.cpp @@ -21,14 +21,11 @@ #include "common/common_definitions.h" #include "common/data_format.h" -#include "core/dpn.h" -#include "core/pack_int.h" -#include "core/pack_str.h" -#include "core/tianmu_attr.h" -#include "core/tianmu_attr_typeinfo.h" -#include "core/tools.h" #include "core/transaction.h" #include "core/value.h" +#include "data/dpn.h" +#include "data/pack_int.h" +#include "data/pack_str.h" #include "loader/load_parser.h" #include "loader/value_cache.h" #include "system/fet.h" @@ -36,6 +33,9 @@ #include "types/tianmu_data_types.h" #include "util/fs.h" #include "util/log_ctl.h" +#include "util/tools.h" +#include "vc/tianmu_attr.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/tianmu_attr.h b/storage/tianmu/vc/tianmu_attr.h similarity index 98% rename from storage/tianmu/core/tianmu_attr.h rename to storage/tianmu/vc/tianmu_attr.h index ad55a170a..d5996c761 100644 --- a/storage/tianmu/core/tianmu_attr.h +++ b/storage/tianmu/vc/tianmu_attr.h @@ -22,25 +22,25 @@ #include "common/assert.h" #include "common/common_definitions.h" -#include "core/bin_tools.h" -#include "core/column_share.h" -#include "core/dpn.h" #include "core/ftree.h" -#include "core/pack.h" -#include "core/physical_column.h" -#include "core/rough_multi_index.h" -#include "core/rsi_bloom.h" -#include "core/rsi_cmap.h" -#include "core/rsi_histogram.h" -#include "core/tianmu_attr_typeinfo.h" -#include "core/tools.h" +#include "data/dpn.h" +#include "data/pack.h" +#include "index/rough_multi_index.h" +#include "index/rsi_bloom.h" +#include "index/rsi_cmap.h" +#include "index/rsi_histogram.h" #include "loader/value_cache.h" #include "mm/traceable_object.h" #include "system/file_system.h" #include "system/tianmu_system.h" #include "types/tianmu_data_types.h" #include "types/tianmu_num.h" +#include "util/bin_tools.h" #include "util/fs.h" +#include "util/tools.h" +#include "vc/column_share.h" +#include "vc/physical_column.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/tianmu_attr_exeq_rs.cpp b/storage/tianmu/vc/tianmu_attr_exeq_rs.cpp similarity index 99% rename from storage/tianmu/core/tianmu_attr_exeq_rs.cpp rename to storage/tianmu/vc/tianmu_attr_exeq_rs.cpp index ae8453f85..e844e8e56 100644 --- a/storage/tianmu/core/tianmu_attr_exeq_rs.cpp +++ b/storage/tianmu/vc/tianmu_attr_exeq_rs.cpp @@ -16,16 +16,16 @@ */ // This is a part of TianmuAttr implementation concerned with the KNs and its usage -#include "core/cq_term.h" #include "core/engine.h" -#include "core/pack.h" -#include "core/pack_guardian.h" -#include "core/tianmu_attr.h" -#include "core/tianmu_attr_typeinfo.h" #include "core/value_set.h" +#include "data/pack.h" +#include "data/pack_guardian.h" +#include "optimizer/compile/cq_term.h" #include "types/text_stat.h" #include "vc/multi_value_column.h" #include "vc/single_column.h" +#include "vc/tianmu_attr.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/tianmu_attr_exqp.cpp b/storage/tianmu/vc/tianmu_attr_exqp.cpp similarity index 99% rename from storage/tianmu/core/tianmu_attr_exqp.cpp rename to storage/tianmu/vc/tianmu_attr_exqp.cpp index 16d5031d5..6879e9f64 100644 --- a/storage/tianmu/core/tianmu_attr_exqp.cpp +++ b/storage/tianmu/vc/tianmu_attr_exqp.cpp @@ -21,18 +21,18 @@ */ #include "common/assert.h" -#include "core/cq_term.h" -#include "core/pack_guardian.h" -#include "core/pack_str.h" -#include "core/tianmu_attr.h" -#include "core/tianmu_attr_typeinfo.h" -#include "core/tools.h" #include "core/transaction.h" #include "core/value_set.h" +#include "data/pack_guardian.h" +#include "data/pack_str.h" +#include "optimizer/compile/cq_term.h" #include "util/hash64.h" +#include "util/tools.h" #include "vc/const_column.h" #include "vc/in_set_column.h" #include "vc/single_column.h" +#include "vc/tianmu_attr.h" +#include "vc/tianmu_attr_typeinfo.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/tianmu_attr_typeinfo.cpp b/storage/tianmu/vc/tianmu_attr_typeinfo.cpp similarity index 95% rename from storage/tianmu/core/tianmu_attr_typeinfo.cpp rename to storage/tianmu/vc/tianmu_attr_typeinfo.cpp index 4ba59ac72..571b8332e 100644 --- a/storage/tianmu/core/tianmu_attr_typeinfo.cpp +++ b/storage/tianmu/vc/tianmu_attr_typeinfo.cpp @@ -15,12 +15,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "tianmu_attr_typeinfo.h" +#include "vc/tianmu_attr_typeinfo.h" #include "common/data_format.h" #include "common/txt_data_format.h" -#include "core/tianmu_attr.h" #include "types/tianmu_data_types.h" #include "types/tianmu_num.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace core { diff --git a/storage/tianmu/core/tianmu_attr_typeinfo.h b/storage/tianmu/vc/tianmu_attr_typeinfo.h similarity index 100% rename from storage/tianmu/core/tianmu_attr_typeinfo.h rename to storage/tianmu/vc/tianmu_attr_typeinfo.h diff --git a/storage/tianmu/vc/type_cast_column.h b/storage/tianmu/vc/type_cast_column.h index 8a4b0db27..033164e01 100644 --- a/storage/tianmu/vc/type_cast_column.h +++ b/storage/tianmu/vc/type_cast_column.h @@ -18,7 +18,7 @@ #define TIANMU_VC_TYPE_CAST_COLUMN_H_ #pragma once -#include "core/mi_iterator.h" +#include "optimizer/iterators/mi_iterator.h" #include "vc/virtual_column.h" namespace Tianmu { diff --git a/storage/tianmu/vc/virtual_column.h b/storage/tianmu/vc/virtual_column.h index a351c7a69..2ad184e44 100644 --- a/storage/tianmu/vc/virtual_column.h +++ b/storage/tianmu/vc/virtual_column.h @@ -18,7 +18,7 @@ #define TIANMU_VC_VIRTUAL_COLUMN_H_ #pragma once -#include "core/pack_guardian.h" +#include "data/pack_guardian.h" #include "vc/virtual_column_base.h" namespace Tianmu { diff --git a/storage/tianmu/vc/virtual_column_base.cpp b/storage/tianmu/vc/virtual_column_base.cpp index aed0c37be..4efe04f8c 100644 --- a/storage/tianmu/vc/virtual_column_base.cpp +++ b/storage/tianmu/vc/virtual_column_base.cpp @@ -17,11 +17,11 @@ #include "vc/virtual_column_base.h" -#include "core/compiled_query.h" #include "core/mysql_expression.h" -#include "core/tianmu_attr.h" +#include "optimizer/compile/compiled_query.h" #include "vc/in_set_column.h" #include "vc/subselect_column.h" +#include "vc/tianmu_attr.h" namespace Tianmu { namespace vcolumn { diff --git a/storage/tianmu/vc/virtual_column_base.h b/storage/tianmu/vc/virtual_column_base.h index 9fce8bed3..285360937 100644 --- a/storage/tianmu/vc/virtual_column_base.h +++ b/storage/tianmu/vc/virtual_column_base.h @@ -20,12 +20,12 @@ #include -#include "core/column.h" #include "core/just_a_table.h" -#include "core/multi_index.h" #include "core/mysql_expression.h" -#include "core/pack_guardian.h" +#include "data/pack_guardian.h" +#include "index/multi_index.h" #include "types/text_stat.h" +#include "vc/column.h" namespace Tianmu { namespace core {