Github user jianqiao commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/73#discussion_r73079256
  
    --- Diff: query_optimizer/rules/SwapProbeBuild.hpp ---
    @@ -0,0 +1,46 @@
    +#ifndef QUICKSTEP_QUERY_OPTIMIZER_RULES_SWAP_PROBE_BUILD_HPP_
    +#define QUICKSTEP_QUERY_OPTIMIZER_RULES_SWAP_PROBE_BUILD_HPP_
    +
    +#include <string>
    +
    +#include "query_optimizer/physical/Physical.hpp"
    +#include "query_optimizer/rules/Rule.hpp"
    +#include "query_optimizer/rules/BottomUpRule.hpp"
    +#include "query_optimizer/cost_model/StarSchemaSimpleCostModel.hpp"
    +#include "utility/Macros.hpp"
    +
    +namespace quickstep {
    +namespace optimizer {
    +
    +/** \addtogroup OptimizerRules
    + *  @{
    + */
    +
    +namespace P = ::quickstep::optimizer::physical;
    +namespace E = ::quickstep::optimizer::expressions;
    +namespace C = ::quickstep::optimizer::cost;
    +
    +/**
    + * @brief Rule that applies to a physical plan to arrange probe and
    + *        build side based on the cardinalities.
    + */
    +class SwapProbeBuild : public BottomUpRule<P::Physical> {
    + public:
    +  SwapProbeBuild() {
    +  }
    +
    +  std::string getName() const override { return "SwapProbeBuild"; }
    +
    + protected:
    +  P::PhysicalPtr applyToNode(const P::PhysicalPtr &input) override;
    +
    + private:
    +  DISALLOW_COPY_AND_ASSIGN(SwapProbeBuild);
    +
    +  std::unique_ptr<C::StarSchemaSimpleCostModel> cost_model_;
    --- End diff --
    
    Currently use `SimpleCostModel` instead of `StarSchemaSimpleCostModel` for 
deciding the build/probe sides.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to