@@ -72,8 +72,6 @@ static void disable_inheritance_subselect(Query *parse);
7272static bool disable_inheritance_subselect_walker (Node * node ,void * context );
7373
7474/* 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 );
7775static void handle_binary_opexpr (WalkerContext * context ,WrapperNode * result ,const Node * varnode ,const Const * c );
7876static void handle_binary_opexpr_param (const PartRelationInfo * prel ,WrapperNode * result ,const Node * varnode );
7977static WrapperNode * handle_opexpr (const OpExpr * expr ,WalkerContext * context );
@@ -805,38 +803,6 @@ finish_least_greatest(WrapperNode *wrap, WalkerContext *context)
805803context -> hasGreatest = false;
806804}
807805
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-
840806/*
841807 *This function determines which partitions should appear in query plan
842808 */
@@ -879,34 +845,6 @@ handle_binary_opexpr(WalkerContext *context, WrapperNode *result,
879845switch (prel -> parttype )
880846{
881847case 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
910848if (strategy == BTEqualStrategyNumber )
911849{
912850value = OidFunctionCall1 (prel -> hash_proc ,c -> constvalue );