Skip to content

Commit

Permalink
seqassign distributor table size increased from 1k to 10k
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeishan authored and netj committed Jan 24, 2017
1 parent 7b1f202 commit 6098b23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion database/db-driver/greenplum/db-assign_sequential_id
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ done
# http://stackoverflow.com/questions/22841206/calculating-cumulative-sum-in-postgresql
# Use larger table idstats_distributor to ensure stats are processed by all segments.
# Assuming 1000 rows cover all segments.
# Update (Jan3): 1000 rows sometimes fail to cover all segments after join, increased to 10000
# (see explain analyze)
SQL="$SQL
CREATE TEMP TABLE idstats_rollup AS
SELECT pid, gpsid, total, SUM(total) OVER (PARTITION BY pid ORDER BY gpsid) AS cum_total
Expand All @@ -64,7 +66,7 @@ CREATE TEMP TABLE idstats_bases AS
DISTRIBUTED RANDOMLY;
CREATE TEMP TABLE idstats_distributor as
SELECT generate_series(1, 1000) id
SELECT generate_series(1, 10000) id
DISTRIBUTED BY (id);
ANALYZE idstats_bases;
Expand Down

0 comments on commit 6098b23

Please sign in to comment.