Skip to content

Commit f6c5e52

Browse files
committed
cleanup
1 parent b323f4d commit f6c5e52

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

src/pg_pathman.c

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ static void disable_inheritance_subselect(Query *parse);
7272
static 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);
7775
static void handle_binary_opexpr(WalkerContext *context, WrapperNode *result, const Node *varnode, const Const *c);
7876
static void handle_binary_opexpr_param(const PartRelationInfo *prel, WrapperNode *result, const Node *varnode);
7977
static WrapperNode *handle_opexpr(const OpExpr *expr, WalkerContext *context);
@@ -805,38 +803,6 @@ finish_least_greatest(WrapperNode *wrap, WalkerContext *context)
805803
context->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,
879845
switch (prel->parttype)
880846
{
881847
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
910848
if (strategy == BTEqualStrategyNumber)
911849
{
912850
value = OidFunctionCall1(prel->hash_proc, c->constvalue);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy