explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2g1O

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 952.296 ↑ 1.0 1 1

Sort (cost=18,199.04..18,199.05 rows=1 width=272) (actual time=952.296..952.296 rows=1 loops=1)

  • Sort Key: collection.billing_loan_id DESC, cc.create_time DESC
  • Sort Method: quicksort Memory: 26kB
2. 16.155 952.265 ↑ 1.0 1 1

Hash Join (cost=15,868.68..18,199.03 rows=1 width=272) (actual time=759.026..952.265 rows=1 loops=1)

  • Hash Cond: (cc.collection_id = collection.id)
3. 43.121 935.016 ↓ 1.0 64,338 1

Unique (cost=15,718.68..17,165.10 rows=64,285 width=148) (actual time=659.954..935.016 rows=64,338 loops=1)

4. 782.021 891.895 ↓ 1.0 64,375 1

Sort (cost=15,718.68..15,879.40 rows=64,285 width=148) (actual time=659.952..891.895 rows=64,375 loops=1)

  • Sort Key: cc.text, cc.collection_id, cc.init_obj_id, cc.create_time, ('comment'::text), p.name, p.obj_id, p.email
  • Sort Method: external merge Disk: 33112kB
5. 24.529 109.874 ↓ 1.0 64,375 1

Append (cost=5.35..5,747.82 rows=64,285 width=148) (actual time=1.626..109.874 rows=64,375 loops=1)

6. 3.991 14.628 ↓ 1.0 6,328 1

Hash Left Join (cost=5.35..241.27 rows=6,317 width=251) (actual time=1.626..14.628 rows=6,328 loops=1)

  • Hash Cond: (cc.init_obj_id = p.obj_id)
7. 10.084 10.084 ↓ 1.0 6,328 1

Seq Scan on collection_comment cc (cost=0.00..218.17 rows=6,317 width=163) (actual time=1.061..10.084 rows=6,328 loops=1)

8. 0.030 0.553 ↑ 1.0 60 1

Hash (cost=4.60..4.60 rows=60 width=56) (actual time=0.552..0.553 rows=60 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
9. 0.523 0.523 ↑ 1.0 60 1

Seq Scan on person p (cost=0.00..4.60 rows=60 width=56) (actual time=0.006..0.523 rows=60 loops=1)

10. 36.023 70.717 ↓ 1.0 58,047 1

Hash Left Join (cost=5.35..4,863.70 rows=57,968 width=555) (actual time=0.088..70.717 rows=58,047 loops=1)

  • Hash Cond: (cr.init_obj_id = p_1.obj_id)
11. 34.636 34.636 ↓ 1.0 58,047 1

Seq Scan on collection_report cr (cost=0.00..4,695.44 rows=57,968 width=467) (actual time=0.006..34.636 rows=58,047 loops=1)

  • Filter: ((comment IS NOT NULL) AND (comment <> ''::text))
  • Rows Removed by Filter: 71
12. 0.024 0.058 ↑ 1.0 60 1

Hash (cost=4.60..4.60 rows=60 width=56) (actual time=0.058..0.058 rows=60 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
13. 0.034 0.034 ↑ 1.0 60 1

Seq Scan on person p_1 (cost=0.00..4.60 rows=60 width=56) (actual time=0.006..0.034 rows=60 loops=1)

14. 0.005 1.094 ↑ 1.0 1 1

Hash (cost=149.98..149.98 rows=1 width=124) (actual time=1.094..1.094 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.002 1.089 ↑ 1.0 1 1

Nested Loop (cost=1.13..149.98 rows=1 width=124) (actual time=1.086..1.089 rows=1 loops=1)

16. 0.002 1.077 ↑ 2.0 1 1

Nested Loop (cost=0.84..149.31 rows=2 width=4) (actual time=1.076..1.077 rows=1 loops=1)

17. 1.065 1.065 ↑ 12.0 1 1

Index Scan using application_client_id_idx on application (cost=0.42..48.09 rows=12 width=4) (actual time=1.064..1.065 rows=1 loops=1)

  • Index Cond: (client_id = 264189)
18. 0.010 0.010 ↑ 1.0 1 1

Index Scan using billing_loan_application_id_uniq on billing_loan loan (cost=0.42..8.44 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: (application_id = application.obj_id)
19. 0.010 0.010 ↑ 1.0 1 1

Index Scan using collection_billing_loan_id on collection (cost=0.29..0.33 rows=1 width=120) (actual time=0.008..0.010 rows=1 loops=1)

  • Index Cond: (billing_loan_id = loan.obj_id)