explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CMSi

Settings
# exclusive inclusive rows x rows loops node
1. 17.542 56.805 ↑ 1.0 37,579 1

HashAggregate (cost=15,691.48..16,073.58 rows=38,210 width=20) (actual time=50.720..56.805 rows=37,579 loops=1)

  • Group Key: f.id
2. 16.910 39.263 ↑ 5.0 37,579 1

Hash Join (cost=2,033.60..14,756.78 rows=186,941 width=20) (actual time=7.572..39.263 rows=37,579 loops=1)

  • Hash Cond: (f.attendance_period_id = ap.id)
  • Join Filter: (((racl.form_type_id = f.form_type_id) OR (racl.form_type_id IS NULL)) AND ((racl.physician_id = f.physician_id) OR (racl.physician_id IS NULL)))
3. 15.394 15.394 ↑ 1.0 38,210 1

Seq Scan on forms f (cost=0.00..9,490.10 rows=38,210 width=64) (actual time=0.588..15.394 rows=38,210 loops=1)

4. 0.943 6.959 ↑ 5.2 6,087 1

Hash (cost=1,638.23..1,638.23 rows=31,630 width=52) (actual time=6.959..6.959 rows=6,087 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 566kB
5. 1.625 6.016 ↑ 5.2 6,087 1

Hash Join (cost=286.33..1,638.23 rows=31,630 width=52) (actual time=2.197..6.016 rows=6,087 loops=1)

  • Hash Cond: (a.registry_id = r.id)
  • Join Filter: ((racl.institute_id = ap.institute_id) OR (racl.institute_id IS NULL))
6. 1.722 3.959 ↑ 1.0 6,254 1

Hash Join (cost=239.72..437.68 rows=6,254 width=48) (actual time=1.761..3.959 rows=6,254 loops=1)

  • Hash Cond: (ap.attendance_id = a.id)
7. 0.487 0.487 ↑ 1.0 6,254 1

Seq Scan on attendance_periods ap (cost=0.00..181.54 rows=6,254 width=48) (actual time=0.003..0.487 rows=6,254 loops=1)

8. 0.897 1.750 ↑ 1.0 6,254 1

Hash (cost=161.54..161.54 rows=6,254 width=32) (actual time=1.750..1.750 rows=6,254 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 455kB
9. 0.853 0.853 ↑ 1.0 6,254 1

Seq Scan on attendances a (cost=0.00..161.54 rows=6,254 width=32) (actual time=0.002..0.853 rows=6,254 loops=1)

10. 0.005 0.432 ↑ 14.5 21 1

Hash (cost=42.81..42.81 rows=305 width=84) (actual time=0.432..0.432 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
11. 0.007 0.427 ↑ 14.5 21 1

Hash Join (cost=18.77..42.81 rows=305 width=84) (actual time=0.312..0.427 rows=21 loops=1)

  • Hash Cond: (racl.registry_id = r.id)
12. 0.075 0.408 ↑ 14.5 21 1

Hash Join (cost=17.25..40.34 rows=305 width=68) (actual time=0.297..0.408 rows=21 loops=1)

  • Hash Cond: (racl.trustee_id = get_trustee_list.trustee_id)
13. 0.043 0.043 ↑ 1.0 610 1

Seq Scan on registry_acl racl (cost=0.00..18.10 rows=610 width=84) (actual time=0.002..0.043 rows=610 loops=1)

14. 0.001 0.290 ↑ 100.0 2 1

Hash (cost=14.75..14.75 rows=200 width=16) (actual time=0.290..0.290 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.005 0.289 ↑ 100.0 2 1

HashAggregate (cost=12.75..14.75 rows=200 width=16) (actual time=0.288..0.289 rows=2 loops=1)

  • Group Key: get_trustee_list.trustee_id
16. 0.284 0.284 ↑ 500.0 2 1

Function Scan on get_trustee_list (cost=0.25..10.25 rows=1,000 width=16) (actual time=0.284..0.284 rows=2 loops=1)

17. 0.005 0.012 ↑ 1.0 23 1

Hash (cost=1.23..1.23 rows=23 width=16) (actual time=0.012..0.012 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
18. 0.007 0.007 ↑ 1.0 23 1

Seq Scan on registries r (cost=0.00..1.23 rows=23 width=16) (actual time=0.004..0.007 rows=23 loops=1)

Planning time : 2.548 ms
Execution time : 58.278 ms