explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5vvL

Settings
# exclusive inclusive rows x rows loops node
1. 7.811 10,718.918 ↑ 33.9 438 1

Finalize GroupAggregate (cost=5,019,378.92..5,038,566.21 rows=14,868 width=191) (actual time=9,112.746..10,718.918 rows=438 loops=1)

  • Group Key: live_daily_summary.brand_id, brand_info.brand, (to_char((CURRENT_DATE)::timestamp with time zone, 'MONTH'::text))
2. 530.967 10,711.107 ↑ 32.4 3,673 1

Gather Merge (cost=5,019,378.92..5,035,295.25 rows=118,944 width=159) (actual time=9,111.227..10,711.107 rows=3,673 loops=1)

  • Workers Planned: 8
  • Workers Launched: 8
3. 659.731 10,180.140 ↑ 36.4 408 9 / 9

Partial GroupAggregate (cost=5,018,378.78..5,019,623.41 rows=14,868 width=159) (actual time=9,072.201..10,180.140 rows=408 loops=9)

  • Group Key: live_daily_summary.brand_id, brand_info.brand, (to_char((CURRENT_DATE)::timestamp with time zone, 'MONTH'::text))
4. 2,362.743 9,520.409 ↓ 30.1 1,503,499 9 / 9

Sort (cost=5,018,378.78..5,018,503.48 rows=49,882 width=90) (actual time=9,071.807..9,520.409 rows=1,503,499 loops=9)

  • Sort Key: live_daily_summary.brand_id, brand_info.brand
  • Sort Method: external merge Disk: 122,904kB
5. 1,393.777 7,157.666 ↓ 30.1 1,503,499 9 / 9

Hash Left Join (cost=35.25..5,014,486.43 rows=49,882 width=90) (actual time=2,026.221..7,157.666 rows=1,503,499 loops=9)

  • Hash Cond: ((live_daily_summary.brand_id)::text = (brand_info.live_brand_id)::text)
6. 5,762.386 5,762.386 ↓ 30.1 1,503,499 9 / 9

Parallel Seq Scan on live_daily_summary (cost=0.00..5,010,268.58 rows=49,882 width=44) (actual time=2,024.443..5,762.386 rows=1,503,499 loops=9)

  • Filter: (date_trunc('month'::text, (summary)::timestamp with time zone) = '2020-08-01 00:00:00+05:30'::timestamp with time zone)
  • Rows Removed by Filter: 7,965,780
7. 0.141 1.503 ↓ 9.4 555 9 / 9

Hash (cost=34.51..34.51 rows=59 width=19) (actual time=1.503..1.503 rows=555 loops=9)

  • Buckets: 1,024 Batches: 1 Memory Usage: 47kB
8. 1.362 1.362 ↓ 9.4 555 9 / 9

Index Scan using brand_info_idx on brand_info (cost=0.29..34.51 rows=59 width=19) (actual time=0.068..1.362 rows=555 loops=9)

  • Index Cond: (((product)::text = 'LIVE'::text) AND ((server)::text = 'LIVE'::text))
  • Filter: (start_date IS NOT NULL)
  • Rows Removed by Filter: 590
Planning time : 4.303 ms
Execution time : 10,737.992 ms