Rename functions and files

pull/1282/head
Onder Kalaci 2017-04-11 11:10:31 +03:00
parent 47fc6a7afe
commit e635de95a0
4 changed files with 32 additions and 31 deletions

View File

@ -34,9 +34,9 @@
#include "distributed/multi_logical_optimizer.h" #include "distributed/multi_logical_optimizer.h"
#include "distributed/multi_physical_planner.h" #include "distributed/multi_physical_planner.h"
#include "distributed/multi_router_planner.h" #include "distributed/multi_router_planner.h"
#include "distributed/multi_planner_utils.h"
#include "distributed/listutils.h" #include "distributed/listutils.h"
#include "distributed/citus_ruleutils.h" #include "distributed/citus_ruleutils.h"
#include "distributed/relation_restriction_equivalence.h"
#include "distributed/relay_utility.h" #include "distributed/relay_utility.h"
#include "distributed/resource_lock.h" #include "distributed/resource_lock.h"
#include "distributed/shardinterval_utils.h" #include "distributed/shardinterval_utils.h"
@ -280,7 +280,7 @@ CreateInsertSelectRouterPlan(Query *originalQuery,
RelationRestrictionContext *relationRestrictionContext = RelationRestrictionContext *relationRestrictionContext =
plannerRestrictionContext->relationRestrictionContext; plannerRestrictionContext->relationRestrictionContext;
bool allReferenceTables = relationRestrictionContext->allReferenceTables; bool allReferenceTables = relationRestrictionContext->allReferenceTables;
bool allRelationsJoinedOnPartitionKey = false; bool restrictionEquivalenceForPartitionKeys = false;
multiPlan->operation = originalQuery->commandType; multiPlan->operation = originalQuery->commandType;
@ -296,8 +296,8 @@ CreateInsertSelectRouterPlan(Query *originalQuery,
return multiPlan; return multiPlan;
} }
allRelationsJoinedOnPartitionKey = restrictionEquivalenceForPartitionKeys =
AllRelationsJoinedOnPartitionKey(plannerRestrictionContext); RestrictionEquivalenceForPartitionKeys(plannerRestrictionContext);
/* /*
* Plan select query for each shard in the target table. Do so by replacing the * Plan select query for each shard in the target table. Do so by replacing the
@ -317,7 +317,7 @@ CreateInsertSelectRouterPlan(Query *originalQuery,
modifyTask = RouterModifyTaskForShardInterval(originalQuery, targetShardInterval, modifyTask = RouterModifyTaskForShardInterval(originalQuery, targetShardInterval,
relationRestrictionContext, relationRestrictionContext,
taskIdIndex, taskIdIndex,
allRelationsJoinedOnPartitionKey); restrictionEquivalenceForPartitionKeys);
/* add the task if it could be created */ /* add the task if it could be created */
if (modifyTask != NULL) if (modifyTask != NULL)

View File

@ -1,5 +1,5 @@
/* /*
* multi_planner_utils.c * relation_restriction_equivalence.c
* *
* This file contains functions helper functions for planning * This file contains functions helper functions for planning
* queries with colocated tables and subqueries. * queries with colocated tables and subqueries.
@ -10,10 +10,10 @@
*/ */
#include "postgres.h" #include "postgres.h"
#include "distributed/multi_planner_utils.h"
#include "distributed/multi_planner.h" #include "distributed/multi_planner.h"
#include "distributed/multi_logical_planner.h" #include "distributed/multi_logical_planner.h"
#include "distributed/pg_dist_partition.h" #include "distributed/pg_dist_partition.h"
#include "distributed/relation_restriction_equivalence.h"
#include "nodes/nodeFuncs.h" #include "nodes/nodeFuncs.h"
#include "nodes/pg_list.h" #include "nodes/pg_list.h"
#include "nodes/primnodes.h" #include "nodes/primnodes.h"
@ -92,7 +92,7 @@ static void ListConcatUniqueAttributeClassMemberLists(AttributeEquivalenceClass
secondClass); secondClass);
/* /*
* AllRelationsJoinedOnPartitionKey aims to deduce whether each of the RTE_RELATION * RestrictionEquivalenceForPartitionKeys aims to deduce whether each of the RTE_RELATION
* is joined with at least one another RTE_RELATION on their partition keys. If each * is joined with at least one another RTE_RELATION on their partition keys. If each
* RTE_RELATION follows the above rule, we can conclude that all RTE_RELATIONs are * RTE_RELATION follows the above rule, we can conclude that all RTE_RELATIONs are
* joined on their partition keys. * joined on their partition keys.
@ -123,7 +123,8 @@ static void ListConcatUniqueAttributeClassMemberLists(AttributeEquivalenceClass
* and GenerateAttributeEquivalencesForJoinRestrictions() * and GenerateAttributeEquivalencesForJoinRestrictions()
*/ */
bool bool
AllRelationsJoinedOnPartitionKey(PlannerRestrictionContext *plannerRestrictionContext) RestrictionEquivalenceForPartitionKeys(
PlannerRestrictionContext *plannerRestrictionContext)
{ {
RelationRestrictionContext *restrictionContext = RelationRestrictionContext *restrictionContext =
plannerRestrictionContext->relationRestrictionContext; plannerRestrictionContext->relationRestrictionContext;

View File

@ -1,22 +0,0 @@
/*
* multi_planner_utils.h
*
* This file contains functions helper functions for planning
* queries with colocated tables and subqueries.
*
* Copyright (c) 2017-2017, Citus Data, Inc.
*
*-------------------------------------------------------------------------
*/
#ifndef MULTI_PLANNER_UTILS_H
#define MULTI_PLANNER_UTILS_H
#include "distributed/multi_planner.h"
extern bool AllRelationsJoinedOnPartitionKey(PlannerRestrictionContext *
plannerRestrictionContext);
#endif /* MULTI_PLANNER_UTILS_H */

View File

@ -0,0 +1,22 @@
/*
* relation_restriction_equivalence.h
*
* This file contains functions helper functions for planning
* queries with colocated tables and subqueries.
*
* Copyright (c) 2017-2017, Citus Data, Inc.
*
*-------------------------------------------------------------------------
*/
#ifndef RELATION_RESTRICTION_EQUIVALENCE_H
#define RELATION_RESTRICTION_EQUIVALENCE_H
#include "distributed/multi_planner.h"
extern bool RestrictionEquivalenceForPartitionKeys(PlannerRestrictionContext *
plannerRestrictionContext);
#endif /* RELATION_RESTRICTION_EQUIVALENCE_H */