explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qSLt

Settings
# exclusive inclusive rows x rows loops node
1. 205.885 34,472.444 ↓ 2.3 22,439 1

Finalize GroupAggregate (cost=2,293,908.21..2,295,672.49 rows=9,610 width=135) (actual time=31,509.779..34,472.444 rows=22,439 loops=1)

  • Group Key: a.revenue_date, a.brand_id, a.platform_id, brand_info.brand, a.server, a.product
2. 1,430.413 34,266.559 ↓ 9.2 88,810 1

Gather Merge (cost=2,293,908.21..2,295,143.91 rows=9,611 width=135) (actual time=31,509.569..34,266.559 rows=88,810 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
3. 1,893.963 32,836.146 ↓ 8.1 11,101 8 / 8

Partial GroupAggregate (cost=2,292,908.09..2,292,966.44 rows=1,373 width=135) (actual time=30,130.867..32,836.146 rows=11,101 loops=8)

  • Group Key: a.revenue_date, a.brand_id, a.platform_id, brand_info.brand, a.server, a.product
4. 3,886.177 30,942.183 ↓ 2,035.0 2,794,114 8 / 8

Sort (cost=2,292,908.09..2,292,911.52 rows=1,373 width=78) (actual time=30,130.425..30,942.183 rows=2,794,114 loops=8)

  • Sort Key: a.revenue_date, a.brand_id, a.platform_id, brand_info.brand, a.server
  • Sort Method: external merge Disk: 221744kB
5. 2,003.451 27,056.006 ↓ 2,035.0 2,794,114 8 / 8

Nested Loop Left Join (cost=2,291,878.16..2,292,836.53 rows=1,373 width=78) (actual time=9,614.150..27,056.006 rows=2,794,114 loops=8)

6. 1,213.147 11,081.985 ↓ 2,035.0 2,794,114 8 / 8

Merge Join (cost=2,291,877.87..2,292,379.08 rows=1,373 width=65) (actual time=9,614.060..11,081.985 rows=2,794,114 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. 479.802 9,623.984 ↓ 12.7 187,755 8 / 8

Sort (cost=2,284,212.34..2,284,249.40 rows=14,822 width=65) (actual time=9,555.742..9,623.984 rows=187,755 loops=8)

  • Sort Key: a.brand_id, a.platform_id, a.server
  • Sort Method: external merge Disk: 13624kB
8. 9,144.182 9,144.182 ↓ 12.7 187,755 8 / 8

Parallel Seq Scan on daily_revenue_summary a (cost=0.00..2,283,185.51 rows=14,822 width=65) (actual time=3,534.265..9,144.182 rows=187,755 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. 213.209 244.854 ↓ 83.0 2,815,797 8 / 8

Sort (cost=7,665.49..7,750.32 rows=33,933 width=22) (actual time=58.276..244.854 rows=2,815,797 loops=8)

  • Sort Key: c.brand_id, c.platform_id, c.server
  • Sort Method: quicksort Memory: 4217kB
10. 31.645 31.645 ↓ 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.058..31.645 rows=34,311 loops=8)

  • Filter: (((product_type)::text = 'SLOTS'::text) AND ((tabletype)::text = 'Generic'::text))
  • Rows Removed by Filter: 4067
11. 13,970.570 13,970.570 ↑ 1.0 1 22,352,912 / 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,352,912)

  • 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 : 3.974 ms
Execution time : 34,680.061 ms