No matter what version of the GPDB open source code, the number of segments is not considered in the cost evaluation, and only a simple process is done when returning the explain result to QD and make the result more clear.
Asked
Active
Viewed 122 times
2 Answers
0
In Greenplum your query is executed in parallel on all segments, hence all segments accrue the cost. It however doesn't seem helpful to multiply the cost number by the number of segments, this will give you the same query plan with different cost numbers on different Greenplum clusters.

A. Scherbaum
- 809
- 4
- 8
0
Actually, Greenplum uses the number of segments during planning. Stats info is stored in master, Greenplum will use this global info to deduce the stats locally in each segment.
Some examples are listed below:
- Function
adjust_reloptinfo
(big context please refer to the PR: https://github.com/greenplum-db/gpdb/pull/10676) - Function
estimate_num_groups_on_segment
is to estimate the local distinct values given the cluster size and the global number of distincts - Cost model of the Motion takes into account the cluster size:
cdbpath_cost_motion
- ...

kainwen
- 356
- 1
- 12