--SET log_temp_files = 0;

CREATE TABLE skewed AS
SELECT generate_series(1, 50000) % 10 AS key, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
INSERT INTO skewed
SELECT generate_series(10, 99990);
ANALYZE skewed;
ALTER TABLE skewed SET (parallel_workers = 4);

-- parallel with parallel-aware hash join
SET max_parallel_workers_per_gather = 4;
RESET parallel_synchronization_cost;
--SET force_parallel_mode = regress;
SET force_parallel_mode = on;
SET work_mem = '1MB';
SET enable_mergejoin = false;
EXPLAIN ANALYZE
SELECT COUNT(*) FROM skewed r JOIN skewed s USING (key);

