explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2KFa

Settings
# exclusive inclusive rows x rows loops node
1. 213.940 32,794.131 ↓ 2.3 22,424 1

Finalize GroupAggregate (cost=2,293,908.21..2,295,672.49 rows=9,610 width=135) (actual time=29,227.633..32,794.131 rows=22,424 loops=1)

  • Group Key: a.revenue_date, a.brand_id, a.platform_id, brand_info.brand, a.server, a.product
2. 2,607.768 32,580.191 ↓ 9.6 92,118 1

Gather Merge (cost=2,293,908.21..2,295,143.91 rows=9,611 width=135) (actual time=29,226.465..32,580.191 rows=92,118 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
3. 2,197.297 29,972.423 ↓ 8.4 11,515 8 / 8

Partial GroupAggregate (cost=2,292,908.09..2,292,966.44 rows=1,373 width=135) (actual time=26,851.904..29,972.423 rows=11,515 loops=8)

  • Group Key: a.revenue_date, a.brand_id, a.platform_id, brand_info.brand, a.server, a.product
4. 4,174.506 27,775.126 ↓ 2,030.4 2,787,672 8 / 8

Sort (cost=2,292,908.09..2,292,911.52 rows=1,373 width=78) (actual time=26,851.454..27,775.126 rows=2,787,672 loops=8)

  • Sort Key: a.revenue_date, a.brand_id, a.platform_id, brand_info.brand, a.server
  • Sort Method: external merge Disk: 275536kB
5. 2,516.663 23,600.620 ↓ 2,030.4 2,787,672 8 / 8

Nested Loop Left Join (cost=2,291,878.16..2,292,836.53 rows=1,373 width=78) (actual time=5,569.147..23,600.620 rows=2,787,672 loops=8)

6. 1,309.022 7,145.599 ↓ 2,030.4 2,787,672 8 / 8

Merge Join (cost=2,291,877.87..2,292,379.08 rows=1,373 width=65) (actual time=5,569.046..7,145.599 rows=2,787,672 loops=8)

  • Merge Cond: ((a.brand_id = c.brand_id) AND (a.platform_id = c.platform_id) AND ((a.server)::text = (c.server)::text))
7. 353.313 5,579.045 ↓ 12.6 187,477 8 / 8

Sort (cost=2,284,212.34..2,284,249.40 rows=14,822 width=65) (actual time=5,509.538..5,579.045 rows=187,477 loops=8)

  • Sort Key: a.brand_id, a.platform_id, a.server
  • Sort Method: external merge Disk: 16472kB
8. 5,225.732 5,225.732 ↓ 12.6 187,477 8 / 8

Parallel Seq Scan on daily_revenue_summary a (cost=0.00..2,283,185.51 rows=14,822 width=65) (actual time=835.025..5,225.732 rows=187,477 loops=8)

  • Filter: (((product)::text = 'SLOTS'::text) AND (date_trunc('month'::text, (revenue_date)::timestamp with time zone) = '2020-03-01 00:00:00+05:30'::timestamp with time zone))
  • Rows Removed by Filter: 2423608
9. 224.256 257.532 ↓ 82.8 2,808,908 8 / 8

Sort (cost=7,665.49..7,750.32 rows=33,933 width=22) (actual time=59.480..257.532 rows=2,808,908 loops=8)

  • Sort Key: c.brand_id, c.platform_id, c.server
  • Sort Method: quicksort Memory: 4217kB
10. 33.276 33.276 ↓ 1.0 34,311 8 / 8

Seq Scan on revenue_parameters c (cost=0.00..5,111.97 rows=33,933 width=22) (actual time=0.063..33.276 rows=34,311 loops=8)

  • Filter: (((product_type)::text = 'SLOTS'::text) AND ((tabletype)::text = 'Generic'::text))
  • Rows Removed by Filter: 4067
11. 13,938.358 13,938.358 ↑ 1.0 1 22,301,373 / 8

Index Scan using brand_info_idx on brand_info (cost=0.29..0.32 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=22,301,373)

  • Index Cond: (((a.product)::text = (product)::text) AND ((product)::text = 'SLOTS'::text) AND ((a.server)::text = (server)::text) AND (a.brand_id = brand_id))
  • Filter: (a.platform_id = (platform_id)::numeric)
Planning time : 6.399 ms
Execution time : 32,954.385 ms