Hi David,

Sorry if this was discussed before, but why does this patch add any new
code to partprune.c?  AFAICT, there's no functionality changes to the
pruning code.

Both

+bool
+partkey_is_bool_constant_for_query(RelOptInfo *partrel, int partkeycol)

and

+static bool
+matches_boolean_partition_clause(RestrictInfo *rinfo, int partkeycol,
+                                 RelOptInfo *partrel)

seem like their logic is specialized enough to be confined to pathkeys.c,
only because it's needed there.


Regarding

+bool
+partitions_are_ordered(PlannerInfo *root, RelOptInfo *partrel)

I think this could simply be:

bool
partitions_are_ordered(PartitionBoundInfo *boundinfo)

and be defined in partitioning/partbounds.c.  If you think any future
modifications to this will require access to the partition key info in
PartitionScheme, maybe the following is fine:

bool
partitions_are_ordered(RelOptInfo *partrel)

Thanks,
Amit



Reply via email to