explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wT3i

Settings
# exclusive inclusive rows x rows loops node
1. 2.719 28,985.463 ↓ 2.3 22,454 1

Subquery Scan on a (cost=2,293,908.21..2,295,796.05 rows=9,610 width=142) (actual time=25,635.845..28,985.463 rows=22,454 loops=1)

2. 189.325 28,982.744 ↓ 2.3 22,454 1

Finalize GroupAggregate (cost=2,293,908.21..2,295,699.95 rows=9,610 width=142) (actual time=25,635.842..28,982.744 rows=22,454 loops=1)

  • Group Key: a_1.revenue_date, a_1.brand_id, a_1.platform_id, brand_info.brand, a_1.server, a_1.product, c.tabletype
3. 2,713.252 28,793.419 ↓ 9.7 93,149 1

Gather Merge (cost=2,293,908.21..2,295,147.34 rows=9,611 width=142) (actual time=25,635.808..28,793.419 rows=93,149 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
4. 1,955.732 26,080.167 ↓ 8.5 11,644 8 / 8

Partial GroupAggregate (cost=2,292,908.09..2,292,969.87 rows=1,373 width=142) (actual time=23,344.599..26,080.167 rows=11,644 loops=8)

  • Group Key: a_1.revenue_date, a_1.brand_id, a_1.platform_id, brand_info.brand, a_1.server, a_1.product, c.tabletype
5. 3,739.317 24,124.435 ↓ 2,036.0 2,795,437 8 / 8

Sort (cost=2,292,908.09..2,292,911.52 rows=1,373 width=85) (actual time=23,344.218..24,124.435 rows=2,795,437 loops=8)

  • Sort Key: a_1.revenue_date, a_1.brand_id, a_1.platform_id, brand_info.brand, a_1.server
  • Sort Method: external merge Disk: 314176kB
6. 1,331.915 20,385.118 ↓ 2,036.0 2,795,437 8 / 8

Nested Loop Left Join (cost=2,291,878.16..2,292,836.53 rows=1,373 width=85) (actual time=3,674.542..20,385.118 rows=2,795,437 loops=8)

7. 1,171.210 5,076.016 ↓ 2,036.0 2,795,437 8 / 8

Merge Join (cost=2,291,877.87..2,292,379.08 rows=1,373 width=72) (actual time=3,674.444..5,076.016 rows=2,795,437 loops=8)

  • Merge Cond: ((a_1.brand_id = c.brand_id) AND (a_1.platform_id = c.platform_id) AND ((a_1.server)::text = (c.server)::text))
8. 355.699 3,680.524 ↓ 12.7 187,866 8 / 8

Sort (cost=2,284,212.34..2,284,249.40 rows=14,822 width=65) (actual time=3,621.141..3,680.524 rows=187,866 loops=8)

  • Sort Key: a_1.brand_id, a_1.platform_id, a_1.server
  • Sort Method: external merge Disk: 16880kB
9. 3,324.825 3,324.825 ↓ 12.7 187,866 8 / 8

Parallel Seq Scan on daily_revenue_summary a_1 (cost=0.00..2,283,185.51 rows=14,822 width=65) (actual time=1,620.177..3,324.825 rows=187,866 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
10. 197.807 224.282 ↓ 83.0 2,816,481 8 / 8

Sort (cost=7,665.49..7,750.32 rows=33,933 width=29) (actual time=53.279..224.282 rows=2,816,481 loops=8)

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

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

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

  • Index Cond: (((a_1.product)::text = (product)::text) AND ((product)::text = 'SLOTS'::text) AND ((a_1.server)::text = (server)::text) AND (a_1.brand_id = brand_id))
  • Filter: (a_1.platform_id = (platform_id)::numeric)
Planning time : 9.352 ms
Execution time : 29,166.744 ms