patch 4.0
This commit is contained in:
@ -17,129 +17,74 @@
|
||||
#include "lib/container/ob_se_array.h"
|
||||
#include "sql/engine/px/ob_granule_util.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
|
||||
class ObLogGranuleIterator : public ObLogicalOperator {
|
||||
class ObLogGranuleIterator : public ObLogicalOperator
|
||||
{
|
||||
public:
|
||||
ObLogGranuleIterator(ObLogPlan& plan)
|
||||
: ObLogicalOperator(plan),
|
||||
tablet_size_(common::OB_DEFAULT_TABLET_SIZE),
|
||||
gi_attri_flag_(0),
|
||||
parallel_(0),
|
||||
partition_count_(0),
|
||||
hash_part_(false)
|
||||
{}
|
||||
ObLogGranuleIterator(ObLogPlan &plan) :
|
||||
ObLogicalOperator(plan),
|
||||
tablet_size_(common::OB_DEFAULT_TABLET_SIZE),
|
||||
gi_attri_flag_(0),
|
||||
partition_count_(0),
|
||||
hash_part_(false),
|
||||
bf_info_(),
|
||||
tablet_id_expr_(NULL)
|
||||
{ }
|
||||
virtual ~ObLogGranuleIterator()
|
||||
{}
|
||||
{ }
|
||||
|
||||
const char* get_name() const override;
|
||||
const char *get_name() const;
|
||||
|
||||
virtual int copy_without_child(ObLogicalOperator*& out) override;
|
||||
virtual int allocate_expr_pre(ObAllocExprContext& ctx) override;
|
||||
virtual int allocate_exchange_post(AllocExchContext* ctx) override;
|
||||
virtual int print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type) override;
|
||||
virtual int re_est_cost(const ObLogicalOperator* parent, double need_row_count, bool& re_est) override;
|
||||
virtual int transmit_op_ordering() override;
|
||||
virtual int transmit_local_ordering() override;
|
||||
void set_tablet_size(int64_t tablet_size)
|
||||
{
|
||||
tablet_size_ = tablet_size;
|
||||
};
|
||||
int64_t get_tablet_size()
|
||||
{
|
||||
return tablet_size_;
|
||||
}
|
||||
uint64_t get_flag()
|
||||
{
|
||||
virtual int est_cost() override;
|
||||
virtual int get_op_exprs(ObIArray<ObRawExpr*> &all_exprs) override;
|
||||
virtual int print_my_plan_annotation(char *buf, int64_t &buf_len, int64_t &pos, ExplainType type) override;
|
||||
void set_tablet_size(int64_t tablet_size) { tablet_size_ = tablet_size; };
|
||||
int64_t get_tablet_size() { return tablet_size_; }
|
||||
uint64_t get_flag() {
|
||||
return gi_attri_flag_;
|
||||
}
|
||||
void add_flag(uint64_t attri)
|
||||
{
|
||||
gi_attri_flag_ |= attri;
|
||||
}
|
||||
void add_flag(uint64_t attri);
|
||||
|
||||
bool partition_filter() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_USE_PARTITION_FILTER);
|
||||
}
|
||||
bool pwj_gi() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_PARTITION_WISE);
|
||||
}
|
||||
bool affinitize() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_AFFINITIZE);
|
||||
}
|
||||
bool access_all() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_ACCESS_ALL);
|
||||
}
|
||||
bool with_param_down() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_NLJ_PARAM_DOWN);
|
||||
}
|
||||
bool asc_partition_order() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_ASC_PARTITION_ORDER);
|
||||
}
|
||||
bool desc_partition_order() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_DESC_PARTITION_ORDER);
|
||||
}
|
||||
bool force_partition_granule() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_FORCE_PARTITION_GRANULE);
|
||||
}
|
||||
bool slave_mapping_granule() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_SLAVE_MAPPING);
|
||||
}
|
||||
bool enable_partition_pruning() const
|
||||
{
|
||||
return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_ENABLE_PARTITION_PRUNING);
|
||||
}
|
||||
bool partition_filter() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_USE_PARTITION_FILTER); }
|
||||
bool pwj_gi() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_PARTITION_WISE); }
|
||||
bool affinitize() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_AFFINITIZE); }
|
||||
bool access_all() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_ACCESS_ALL); }
|
||||
bool with_param_down() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_NLJ_PARAM_DOWN); }
|
||||
bool asc_order() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_ASC_ORDER); }
|
||||
bool desc_order() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_DESC_ORDER); }
|
||||
bool force_partition_granule() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_FORCE_PARTITION_GRANULE); }
|
||||
bool slave_mapping_granule() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_SLAVE_MAPPING); }
|
||||
bool enable_partition_pruning() const { return ObGranuleUtil::gi_has_attri(gi_attri_flag_, GI_ENABLE_PARTITION_PRUNING); }
|
||||
|
||||
virtual int compute_op_ordering() override;
|
||||
int is_partitions_ordering(bool& partition_order);
|
||||
int set_partition_order();
|
||||
int set_range_order();
|
||||
|
||||
inline uint64_t get_gi_flags()
|
||||
{
|
||||
return gi_attri_flag_;
|
||||
}
|
||||
void set_parallel(int64_t parallel)
|
||||
{
|
||||
parallel_ = parallel;
|
||||
}
|
||||
inline int64_t get_parallel() const
|
||||
{
|
||||
return parallel_;
|
||||
}
|
||||
void set_partition_count(int64_t partition_count)
|
||||
{
|
||||
partition_count_ = partition_count;
|
||||
}
|
||||
void set_hash_part(bool v)
|
||||
{
|
||||
hash_part_ = v;
|
||||
}
|
||||
bool is_hash_part()
|
||||
{
|
||||
return hash_part_;
|
||||
}
|
||||
inline uint64_t get_gi_flags() { return gi_attri_flag_; }
|
||||
void set_partition_count(int64_t partition_count) { partition_count_ = partition_count; }
|
||||
void set_hash_part(bool v) { hash_part_ = v; }
|
||||
bool is_hash_part() { return hash_part_; }
|
||||
|
||||
int is_partition_gi(bool& partition_granule) const;
|
||||
int is_partition_gi(bool &partition_granule) const;
|
||||
|
||||
ObPxBFStaticInfo &get_join_filter_info() { return bf_info_; }
|
||||
void set_join_filter_info(ObPxBFStaticInfo &bf_info) { bf_info_ = bf_info; }
|
||||
|
||||
void set_tablet_id_expr(ObOpPseudoColumnRawExpr *tablet_id_expr) { tablet_id_expr_ = tablet_id_expr; }
|
||||
ObOpPseudoColumnRawExpr *get_tablet_id_expr() { return tablet_id_expr_; }
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObLogGranuleIterator);
|
||||
int64_t tablet_size_;
|
||||
uint64_t gi_attri_flag_;
|
||||
int64_t parallel_;
|
||||
int64_t partition_count_;
|
||||
bool hash_part_;
|
||||
ObPxBFStaticInfo bf_info_; // for join partition filter
|
||||
ObOpPseudoColumnRawExpr *tablet_id_expr_;
|
||||
};
|
||||
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user