explain.depesz.com

A tool for finding a real cause for slow queries.

Result: mPj

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=37,038,713.42..37,166,487.90 rows=51,109,790 width=162) (actual time=.. rows= loops=)

  • Merge Cond: (p.node_id = n.id)
  • Merge Cond: (main.id = pa.portfolio_id)
  • Merge Cond: (main.id = n.portfolio_id)
  • Merge Cond: (main.id = cte_docs.id)
  • Filter: ((ver_from_instant <= '2012-04-27 13:34:10.271'::timestamp without time zone) AND (ver_to_instant > '2012-04-27 13:34:10.271'::timestamp without time zone) AND (corr_from_instant <= '2012-04-27 13:34:10.271'::timestamp without time zone) AND (corr_to_instant > '2012-04-27 13:34:10.271'::timestamp without time zone) AND (visibility <= 25))
2.          

CTE cte_docs

3. 0.000 0.000 ↓ 0.0

Sort (cost=7,607,942.10..7,646,077.58 rows=15,254,190 width=145) (actual time=.. rows= loops=)

4. 0.000 0.000 ↓ 0.0

Sort (cost=378,215.35..383,334.32 rows=2,047,588 width=19) (actual time=.. rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=173,285.53..175,850.52 rows=1,025,997 width=16) (actual time=.. rows= loops=)

6. 0.000 0.000 ↓ 0.0

Sort (cost=151,014.53..153,579.53 rows=1,025,997 width=8) (actual time=.. rows= loops=)

7. 0.000 0.000 ↓ 0.0

Seq Scan on prt_portfolio (cost=0.00..35,776.93 rows=1,025,997 width=16) (actual time=.. rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on prt_portfolio_attribute pa (cost=0.00..37,592.88 rows=2,047,588 width=19) (actual time=.. rows= loops=)

9. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=7,608,017.86..9,355,991.33 rows=51,109,790 width=162) (actual time=.. rows= loops=)

10. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=529,268.39..1,199,733.13 rows=15,254,190 width=145) (actual time=.. rows= loops=)

11. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=529,229.88..626,759.01 rows=1,971,797 width=82) (actual time=.. rows= loops=)

12. 0.000 0.000 ↓ 0.0

Merge Join (cost=151,014.53..210,903.79 rows=1,025,997 width=71) (actual time=.. rows= loops=)

13. 0.000 0.000 ↓ 0.0

Materialize (cost=7,607,942.10..7,684,213.05 rows=15,254,190 width=145) (actual time=.. rows= loops=)

14. 0.000 0.000 ↓ 0.0

Materialize (cost=378,215.35..388,453.29 rows=2,047,588 width=19) (actual time=.. rows= loops=)

15. 0.000 0.000 ↓ 0.0

Materialize (cost=151,014.53..156,144.52 rows=1,025,997 width=8) (actual time=.. rows= loops=)

16. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..359,075.00 rows=7,937,306 width=71) (actual time=.. rows= loops=)

17. 0.000 0.000 ↓ 0.0

Index Scan using prt_portfolio_pkey on prt_portfolio main (cost=0.00..39,369.32 rows=1,025,997 width=71) (actual time=.. rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan using ix_prt_position_node_id on prt_position p (cost=0.00..902,552.31 rows=26,594,270 width=25) (actual time=.. rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Scan using ix_prt_node_portfolio_id on prt_node n (cost=0.00..339,231.73 rows=7,937,306 width=71) (actual time=.. rows= loops=)

20. 0.000 0.000 ↓ 0.0

CTE Scan on cte_docs (cost=0.00..20,519.94 rows=1,025,997 width=8) (actual time=.. rows= loops=)