explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wARt

Settings
# exclusive inclusive rows x rows loops node
1. 230.073 1,382.713 ↓ 19,782.0 19,782 1

Nested Loop (cost=436.70..445.41 rows=1 width=17) (actual time=305.148..1,382.713 rows=19,782 loops=1)

2.          

CTE rank_list

3. 152.444 528.558 ↓ 860.1 19,782 1

WindowAgg (cost=435.72..436.12 rows=23 width=26) (actual time=302.897..528.558 rows=19,782 loops=1)

4. 150.237 376.114 ↓ 860.1 19,782 1

Sort (cost=435.72..435.78 rows=23 width=18) (actual time=302.882..376.114 rows=19,782 loops=1)

  • Sort Key: dataset_logic_score_investment_int_value.value
  • Sort Method: quicksort Memory: 2,314kB
5. 151.350 225.877 ↓ 860.1 19,782 1

Hash Join (cost=16.97..435.20 rows=23 width=18) (actual time=0.172..225.877 rows=19,782 loops=1)

  • Hash Cond: (dataset_logic_score_investment_int_value.dataset_logic_score_id = dataset_logic_score.id)
6. 74.381 74.381 ↑ 1.0 19,782 1

Seq Scan on dataset_logic_score_investment_int_value (cost=0.00..343.82 rows=19,782 width=22) (actual time=0.013..74.381 rows=19,782 loops=1)

7. 0.013 0.146 ↑ 1.0 1 1

Hash (cost=16.96..16.96 rows=1 width=8) (actual time=0.142..0.146 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.015 0.133 ↑ 1.0 1 1

Nested Loop (cost=0.76..16.96 rows=1 width=8) (actual time=0.096..0.133 rows=1 loops=1)

9. 0.016 0.107 ↑ 1.0 1 1

Nested Loop (cost=0.61..16.77 rows=1 width=4) (actual time=0.077..0.107 rows=1 loops=1)

10. 0.016 0.081 ↑ 1.0 1 1

Nested Loop (cost=0.45..16.57 rows=1 width=4) (actual time=0.059..0.081 rows=1 loops=1)

  • Join Filter: (prioritization_datasets.logic_id = business_logics.id)
11. 0.019 0.053 ↑ 1.0 1 1

Nested Loop (cost=0.30..16.35 rows=1 width=8) (actual time=0.037..0.053 rows=1 loops=1)

12. 0.021 0.021 ↑ 1.0 1 1

Index Scan using prioritization_4_1_datasets_pkey on prioritization_datasets (cost=0.15..8.17 rows=1 width=36) (actual time=0.012..0.021 rows=1 loops=1)

  • Index Cond: (id = 2)
13. 0.013 0.013 ↑ 1.0 1 1

Index Only Scan using prioritization_4_1_investment_cases_logics_pkey on prioritization_investment_cases_logics (cost=0.15..8.17 rows=1 width=36) (actual time=0.010..0.013 rows=1 loops=1)

  • Index Cond: ((investment_case_id = prioritization_datasets.investment_case_id) AND (logic_id = prioritization_datasets.logic_id))
  • Heap Fetches: 1
14. 0.012 0.012 ↑ 1.0 1 1

Index Scan using business_logics_pkey on business_logics (cost=0.15..0.21 rows=1 width=8) (actual time=0.009..0.012 rows=1 loops=1)

  • Index Cond: (id = prioritization_investment_cases_logics.logic_id)
15. 0.010 0.010 ↑ 1.0 1 1

Index Scan using dataset_logics_pkey on dataset_logics (cost=0.15..0.19 rows=1 width=8) (actual time=0.007..0.010 rows=1 loops=1)

  • Index Cond: (id = business_logics.dataset_logic_id)
16. 0.011 0.011 ↑ 1.0 1 1

Index Only Scan using dataset_logic_score_pkey on dataset_logic_score (cost=0.15..0.19 rows=1 width=4) (actual time=0.008..0.011 rows=1 loops=1)

  • Index Cond: (id = dataset_logics.score_logic_id)
  • Heap Fetches: 1
17. 236.682 1,033.948 ↓ 19,782.0 19,782 1

Nested Loop (cost=0.29..8.83 rows=1 width=53) (actual time=304.403..1,033.948 rows=19,782 loops=1)

18. 678.574 678.574 ↓ 19,782.0 19,782 1

CTE Scan on rank_list (cost=0.00..0.52 rows=1 width=44) (actual time=302.906..678.574 rows=19,782 loops=1)

  • Filter: (dataset_id = 2)
19. 118.692 118.692 ↑ 1.0 1 19,782

Index Only Scan using prioritization_4_1_investments_dataset_id_investment_id_unique on prioritization_investments (cost=0.29..8.31 rows=1 width=13) (actual time=0.006..0.006 rows=1 loops=19,782)

  • Index Cond: ((dataset_id = 2) AND (investment_id = rank_list.investment_id))
  • Heap Fetches: 19,782
20. 118.692 118.692 ↑ 1.0 1 19,782

Index Only Scan using prioritization_4_1_investment_financial_metrics_dataset_id_inve on prioritization_investment_financial_metrics (cost=0.29..0.46 rows=1 width=13) (actual time=0.006..0.006 rows=1 loops=19,782)

  • Index Cond: ((dataset_id = 2) AND (investment_id = prioritization_investments.investment_id))
  • Heap Fetches: 19,782