explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pOL

Settings
# exclusive inclusive rows x rows loops node
1. 18.432 81,273.348 ↑ 7.6 1,261 1

Finalize GroupAggregate (cost=2,293,915.07..2,295,734.27 rows=9,610 width=163) (actual time=78,800.519..81,273.348 rows=1,261 loops=1)

  • Group Key: (to_char((a.revenue_date)::timestamp with time zone, 'yyyy-mm'::text)), a.brand_id, a.platform_id, brand_info.brand, a.server, a.product
2. 4,050.077 81,254.916 ↑ 1.1 8,506 1

Gather Merge (cost=2,293,915.07..2,295,157.64 rows=9,611 width=163) (actual time=78,796.920..81,254.916 rows=8,506 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
3. 1,920.722 77,204.839 ↑ 1.3 1,063 8 / 8

Partial GroupAggregate (cost=2,292,914.95..2,292,980.17 rows=1,373 width=163) (actual time=74,955.345..77,204.839 rows=1,063 loops=8)

  • Group Key: (to_char((a.revenue_date)::timestamp with time zone, 'yyyy-mm'::text)), a.brand_id, a.platform_id, brand_info.brand, a.server, a.product
4. 20,693.894 75,284.117 ↓ 2,029.0 2,785,850 8 / 8

Sort (cost=2,292,914.95..2,292,918.38 rows=1,373 width=106) (actual time=74,951.168..75,284.117 rows=2,785,850 loops=8)

  • Sort Key: (to_char((a.revenue_date)::timestamp with time zone, 'yyyy-mm'::text)), a.brand_id, a.platform_id, brand_info.brand, a.server
  • Sort Method: external sort Disk: 270,296kB
5. 3,915.353 54,590.223 ↓ 2,029.0 2,785,850 8 / 8

Nested Loop Left Join (cost=2,291,878.16..2,292,843.40 rows=1,373 width=106) (actual time=35,201.375..54,590.223 rows=2,785,850 loops=8)

6. 1,272.554 36,745.620 ↓ 2,029.0 2,785,850 8 / 8

Merge Join (cost=2,291,877.87..2,292,379.08 rows=1,373 width=65) (actual time=35,201.066..36,745.620 rows=2,785,850 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. 391.777 35,211.229 ↓ 12.6 187,408 8 / 8

Sort (cost=2,284,212.34..2,284,249.40 rows=14,822 width=65) (actual time=35,139.419..35,211.229 rows=187,408 loops=8)

  • Sort Key: a.brand_id, a.platform_id, a.server
  • Sort Method: external merge Disk: 15,360kB
8. 34,819.452 34,819.452 ↓ 12.6 187,408 8 / 8

Parallel Seq Scan on daily_revenue_summary a (cost=0.00..2,283,185.51 rows=14,822 width=65) (actual time=2,327.999..34,819.452 rows=187,408 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: 2,423,608
9. 228.780 261.837 ↓ 82.7 2,807,150 8 / 8

Sort (cost=7,665.49..7,750.32 rows=33,933 width=22) (actual time=61.624..261.837 rows=2,807,150 loops=8)

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

  • Filter: (((product_type)::text = 'SLOTS'::text) AND ((tabletype)::text = 'Generic'::text))
  • Rows Removed by Filter: 4,067
11. 13,929.250 13,929.250 ↑ 1.0 1 22,286,800 / 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,286,800)

  • 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 : 5.910 ms
Execution time : 81,318.746 ms