In Greenplum Database (GPDB) v5, v6 and v7, there is a parameter gp_enable_relsize_collection. The description in the documentation is:
Enables GPORCA and the Postgres-based planner to use the estimated size of a table (pg_relation_size function) if there are no statistics for the table. By default, GPORCA and the planner use a default value to estimate the number of rows if statistics are not available. The default behavior improves query optimization time and reduces resource queue usage in heavy workloads, but can lead to suboptimal plans. This parameter is ignored for a root partitioned table. When GPORCA is enabled and the root partition does not have statistics, GPORCA always uses the default value. You can use ANALZYE ROOTPARTITION to collect statistics on the root partition. See ANALYZE.
ERROR: number of segment databases cannot be 0The queries will run without errors when run normally from the master.
PGOPTIONS='-c gp_session_role=utility psql -h sdw1 -p 6001Set the parameter to "off" before running any queries:
set gp_enable_relsize_collection=off;