explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 49dx

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1,626.114 ↓ 10.0 10 1

Limit (cost=36,305.18..36,305.18 rows=1 width=293) (actual time=1,626.113..1,626.114 rows=10 loops=1)

2. 0.029 1,626.113 ↓ 10.0 10 1

Sort (cost=36,305.18..36,305.18 rows=1 width=293) (actual time=1,626.112..1,626.113 rows=10 loops=1)

  • Sort Key: tb_operation.id_operation DESC, tb_operation_bonds.seq
  • Sort Method: quicksort Memory: 30kB
3. 0.015 1,626.084 ↓ 10.0 10 1

Nested Loop Left Join (cost=178.97..36,305.18 rows=1 width=293) (actual time=1,596.066..1,626.084 rows=10 loops=1)

4. 0.013 1,626.029 ↓ 10.0 10 1

Nested Loop Left Join (cost=178.94..36,302.69 rows=1 width=271) (actual time=1,596.051..1,626.029 rows=10 loops=1)

5. 0.013 1,626.016 ↓ 10.0 10 1

Nested Loop Left Join (cost=178.92..36,300.20 rows=1 width=210) (actual time=1,596.043..1,626.016 rows=10 loops=1)

6. 0.175 1,625.973 ↓ 10.0 10 1

Nested Loop (cost=178.89..36,297.71 rows=1 width=149) (actual time=1,596.024..1,625.973 rows=10 loops=1)

  • Join Filter: (tb_operation_bonds.id_instrument = tb_instrument_bonds.id_instrument)
  • Rows Removed by Join Filter: 2500
7. 0.012 1,625.638 ↓ 10.0 10 1

Nested Loop (cost=178.89..36,296.04 rows=1 width=153) (actual time=1,595.971..1,625.638 rows=10 loops=1)

8. 0.022 1,625.576 ↓ 10.0 10 1

Nested Loop (cost=178.84..36,295.42 rows=1 width=117) (actual time=1,595.949..1,625.576 rows=10 loops=1)

9. 0.169 1,625.490 ↓ 2.0 8 1

Hash Join (cost=178.79..36,287.23 rows=4 width=117) (actual time=1,595.917..1,625.490 rows=8 loops=1)

  • Hash Cond: ((tb_operation.id_broker = tb_operation_bonds.id_broker) AND (tb_operation.id_operation = tb_operation_bonds.id_operation))
10. 1,605.609 1,605.609 ↑ 148.3 7 1

Seq Scan on tb_operation (cost=0.00..36,105.32 rows=1,038 width=67) (actual time=1,576.044..1,605.609 rows=7 loops=1)

  • Filter: ((id_investor = 121322) OR (id_office = 121322))
  • Rows Removed by Filter: 10482245
11. 9.937 19.712 ↓ 1.0 43,961 1

Hash (cost=112.91..112.91 rows=43,915 width=60) (actual time=19.712..19.712 rows=43,961 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 5166kB
12. 9.775 9.775 ↓ 1.0 43,961 1

Seq Scan on tb_operation_bonds (cost=0.00..112.91 rows=43,915 width=60) (actual time=0.006..9.775 rows=43,961 loops=1)

13. 0.064 0.064 ↑ 1.0 1 8

Index Only Scan using tb_investor_owner_pk on tb_investor_owner (cost=0.06..2.05 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=8)

  • Index Cond: ((id_investor_owner = tb_operation.id_office) AND (id_investor = tb_operation.id_investor))
  • Heap Fetches: 0
14. 0.050 0.050 ↑ 1.0 1 10

Index Scan using tb_instrument_pk on tb_instrument (cost=0.04..0.62 rows=1 width=36) (actual time=0.005..0.005 rows=1 loops=10)

  • Index Cond: (id_instrument = tb_operation_bonds.id_instrument)
15. 0.160 0.160 ↑ 1.0 251 10

Seq Scan on tb_instrument_bonds (cost=0.00..1.35 rows=251 width=12) (actual time=0.001..0.016 rows=251 loops=10)

16. 0.030 0.030 ↑ 1.0 1 10

Index Scan using tb_investor_pk on tb_investor tb_investor_assessor (cost=0.03..2.49 rows=1 width=65) (actual time=0.003..0.003 rows=1 loops=10)

  • Index Cond: (id_investor = tb_operation.id_office)
17. 0.000 0.000 ↓ 0.0 0 10

Index Scan using tb_investor_pk on tb_investor tb_investor_operator (cost=0.03..2.49 rows=1 width=65) (actual time=0.000..0.000 rows=0 loops=10)

  • Index Cond: (id_investor = tb_operation.id_operator)
18. 0.040 0.040 ↑ 1.0 1 10

Index Scan using tb_investor_pk on tb_investor (cost=0.03..2.49 rows=1 width=30) (actual time=0.004..0.004 rows=1 loops=10)

  • Index Cond: (id_investor = tb_operation.id_investor)
Planning time : 10.279 ms
Execution time : 1,626.311 ms