@@ -72,8 +72,6 @@ static void disable_inheritance_subselect(Query *parse);
72
72
static bool disable_inheritance_subselect_walker (Node * node ,void * context );
73
73
74
74
/* Expression tree handlers */
75
- static Datum increase_hashable_value (const PartRelationInfo * prel ,Datum value );
76
- static Datum decrease_hashable_value (const PartRelationInfo * prel ,Datum value );
77
75
static void handle_binary_opexpr (WalkerContext * context ,WrapperNode * result ,const Node * varnode ,const Const * c );
78
76
static void handle_binary_opexpr_param (const PartRelationInfo * prel ,WrapperNode * result ,const Node * varnode );
79
77
static WrapperNode * handle_opexpr (const OpExpr * expr ,WalkerContext * context );
@@ -805,38 +803,6 @@ finish_least_greatest(WrapperNode *wrap, WalkerContext *context)
805
803
context -> hasGreatest = false;
806
804
}
807
805
808
- /*
809
- * Increase value of hash partitioned column.
810
- */
811
- static Datum
812
- increase_hashable_value (const PartRelationInfo * prel ,Datum value )
813
- {
814
- switch (prel -> atttype )
815
- {
816
- case INT4OID :
817
- return Int32GetDatum (DatumGetInt32 (value )+ 1 );
818
- default :
819
- elog (ERROR ,"Invalid datatype: %u" ,prel -> atttype );
820
- return (Datum )0 ;
821
- }
822
- }
823
-
824
- /*
825
- * Decrease value of hash partitioned column.
826
- */
827
- static Datum
828
- decrease_hashable_value (const PartRelationInfo * prel ,Datum value )
829
- {
830
- switch (prel -> atttype )
831
- {
832
- case INT4OID :
833
- return Int32GetDatum (DatumGetInt32 (value )- 1 );
834
- default :
835
- elog (ERROR ,"Invalid datatype: %u" ,prel -> atttype );
836
- return (Datum )0 ;
837
- }
838
- }
839
-
840
806
/*
841
807
*This function determines which partitions should appear in query plan
842
808
*/
@@ -879,34 +845,6 @@ handle_binary_opexpr(WalkerContext *context, WrapperNode *result,
879
845
switch (prel -> parttype )
880
846
{
881
847
case PT_HASH :
882
- // value = OidFunctionCall1(prel->hash_proc, c->constvalue);
883
- // if (strategy == BTLessStrategyNumber ||
884
- // strategy == BTLessEqualStrategyNumber)
885
- // {
886
- // // Datum value = c->constvalue;
887
-
888
- // if (strategy == BTLessStrategyNumber)
889
- // value = decrease_hashable_value(prel, value);
890
- // if (!context->hasGreatest || DatumGetInt32(FunctionCall2(&cmp_func, value, context->greatest)) < 0)
891
- // {
892
- // context->greatest = value;
893
- // context->hasGreatest = true;
894
- // }
895
- // }
896
- // else if (strategy == BTGreaterStrategyNumber ||
897
- // strategy == BTGreaterEqualStrategyNumber)
898
- // {
899
- // // Datum value = c->constvalue;
900
-
901
- // if (strategy == BTGreaterStrategyNumber)
902
- // value = increase_hashable_value(prel, value);
903
- // if (!context->hasLeast || DatumGetInt32(FunctionCall2(&cmp_func, value, context->least)) > 0)
904
- // {
905
- // context->least = value;
906
- // context->hasLeast = true;
907
- // }
908
- // }
909
- // else
910
848
if (strategy == BTEqualStrategyNumber )
911
849
{
912
850
value = OidFunctionCall1 (prel -> hash_proc ,c -> constvalue );