explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jeug : IndexForParition

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 610.886 ↑ 288.5 103 1

Sort (cost=202,337.59..202,411.87 rows=29,715 width=43) (actual time=610.881..610.886 rows=103 loops=1)

  • Sort Key: (sum(c.cost)) DESC
  • Sort Method: quicksort Memory: 33kB
2. 106.050 610.855 ↑ 288.5 103 1

HashAggregate (cost=199,758.49..200,129.93 rows=29,715 width=43) (actual time=610.605..610.855 rows=103 loops=1)

  • Group Key: c.usage_type, c.currency
3. 26.600 504.805 ↓ 1.0 298,638 1

Append (cost=0.13..196,786.96 rows=297,153 width=43) (actual time=0.027..504.805 rows=298,638 loops=1)

  • Subplans Removed: 3
4. 478.192 478.192 ↓ 1.0 298,638 1

Index Only Scan using testdate2019jan_april_cost_mo_user_id_account_id_resource__idx5 on testdate2019jan_april_cost_mod3rem2 c (cost=0.69..146,705.43 rows=297,126 width=43) (actual time=0.027..478.192 rows=298,638 loops=1)

  • Index Cond: ((user_id = 1) AND (usage_start_date >= (CURRENT_DATE - 30)) AND (usage_end_date <= CURRENT_DATE))
  • Heap Fetches: 298638
5. 0.010 0.010 ↓ 0.0 0 1

Index Scan using testdate2019may_august_cost_mod3rem2_pkey on testdate2019may_august_cost_mod3rem2 c_1 (cost=0.13..2.35 rows=1 width=43) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: ((usage_start_date >= (CURRENT_DATE - 30)) AND (user_id = 1))
  • Filter: (usage_end_date <= CURRENT_DATE)
6. 0.003 0.003 ↓ 0.0 0 1

Index Scan using testdate2019sept_dec_cost_mod3rem2_pkey on testdate2019sept_dec_cost_mod3rem2 c_2 (cost=0.13..2.35 rows=1 width=43) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((usage_start_date >= (CURRENT_DATE - 30)) AND (user_id = 1))
  • Filter: (usage_end_date <= CURRENT_DATE)
Planning time : 0.970 ms
Execution time : 611.406 ms