explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vbcq

Settings
# exclusive inclusive rows x rows loops node
1. 0.693 2,518.772 ↑ 1,622.2 8 1

GroupAggregate (cost=2,495,294.09..2,524,034.51 rows=12,978 width=135) (actual time=2,459.955..2,518.772 rows=8 loops=1)

  • Group Key: (to_char((daily_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)), daily_summary.server
2. 2.739 2,518.079 ↑ 108.1 1,201 1

Merge Left Join (cost=2,495,294.09..2,521,536.34 rows=129,775 width=167) (actual time=2,459.472..2,518.079 rows=1,201 loops=1)

  • Merge Cond: (((to_char((daily_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)) = (to_char((daily_jackpot_summary.summary)::timestamp with time zone, 'yyyy-mm'::text))) AND ((daily_summary.server)::text = (daily_jackpot_summary.server)::text))
  • Join Filter: ((daily_summary.brand_id = (daily_jackpot_summary.brand_id)::numeric) AND (daily_summary.platform_id = (daily_jackpot_summary.platform_id)::numeric))
  • Rows Removed by Join Filter: 9,199
3. 15.097 2,504.467 ↑ 108.1 1,201 1

Finalize GroupAggregate (cost=2,494,539.60..2,518,826.89 rows=129,775 width=145) (actual time=2,449.068..2,504.467 rows=1,201 loops=1)

  • Group Key: (to_char((daily_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)), daily_summary.server, daily_summary.brand_id, daily_summary.platform_id
4. 40.020 2,489.370 ↑ 16.0 8,309 1

Gather Merge (cost=2,494,539.60..2,511,615.64 rows=132,720 width=145) (actual time=2,448.980..2,489.370 rows=8,309 loops=1)

  • Workers Planned: 8
  • Workers Launched: 8
5. 26.319 2,449.350 ↑ 18.0 923 9 / 9

Partial GroupAggregate (cost=2,493,539.46..2,494,244.53 rows=16,590 width=145) (actual time=2,420.243..2,449.350 rows=923 loops=9)

  • Group Key: (to_char((daily_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)), daily_summary.server, daily_summary.brand_id, daily_summary.platform_id
6. 76.713 2,423.031 ↓ 2.6 42,974 9 / 9

Sort (cost=2,493,539.46..2,493,580.93 rows=16,590 width=88) (actual time=2,420.178..2,423.031 rows=42,974 loops=9)

  • Sort Key: (to_char((daily_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)), daily_summary.server, daily_summary.brand_id, daily_summary.platform_id
  • Sort Method: quicksort Memory: 7,245kB
7. 2,346.318 2,346.318 ↓ 2.6 42,974 9 / 9

Parallel Seq Scan on daily_summary (cost=0.00..2,492,376.66 rows=16,590 width=88) (actual time=341.849..2,346.318 rows=42,974 loops=9)

  • Filter: ((date_trunc('MONTH'::text, (summary)::timestamp with time zone) = '2020-02-01 00:00:00+05:30'::timestamp with time zone) AND ((server)::text = ANY ('{DENMARK,DENMARK1,DENMARK2,TAIWAN,TAIWAN1,GIB,GIB1,BAHAMAS}'::text[])))
  • Rows Removed by Filter: 2,899,691
8. 0.423 10.873 ↓ 146.1 9,061 1

Materialize (cost=754.49..757.45 rows=62 width=76) (actual time=10.393..10.873 rows=9,061 loops=1)

9. 0.072 10.450 ↑ 3.4 18 1

GroupAggregate (cost=754.49..756.68 rows=62 width=76) (actual time=10.387..10.450 rows=18 loops=1)

  • Group Key: (to_char((daily_jackpot_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)), daily_jackpot_summary.server, daily_jackpot_summary.brand_id, daily_jackpot_summary.platform_id
10. 0.150 10.378 ↓ 2.6 161 1

Sort (cost=754.49..754.65 rows=63 width=47) (actual time=10.368..10.378 rows=161 loops=1)

  • Sort Key: (to_char((daily_jackpot_summary.summary)::timestamp with time zone, 'yyyy-mm'::text)), daily_jackpot_summary.server, daily_jackpot_summary.brand_id, daily_jackpot_summary.platform_id
  • Sort Method: quicksort Memory: 37kB
11. 10.228 10.228 ↓ 2.6 161 1

Index Scan using jackpot_summary_pkey on daily_jackpot_summary (cost=0.29..752.61 rows=63 width=47) (actual time=5.208..10.228 rows=161 loops=1)

  • Index Cond: ((server)::text = ANY ('{DENMARK,DENMARK1,DENMARK2,TAIWAN,TAIWAN1,GIB,GIB1,BAHAMAS}'::text[]))
  • Filter: (date_trunc('MONTH'::text, (summary)::timestamp with time zone) = '2020-02-01 00:00:00+05:30'::timestamp with time zone)
  • Rows Removed by Filter: 17,861
Planning time : 1.188 ms
Execution time : 2,530.730 ms