explain.depesz.com

PostgreSQL's explain analyze made readable

Result: on2Q

Settings
# exclusive inclusive rows x rows loops node
1. 17.730 67.390 ↑ 1.0 37,579 1

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

  • Group Key: f.id
2. 15.674 49.660 ↑ 5.0 37,579 1

Hash Join (cost=2,033.60..14,756.78 rows=186,941 width=20) (actual time=8.339..49.660 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. 26.341 26.341 ↑ 1.0 38,210 1

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

4. 1.126 7.645 ↑ 5.2 6,087 1

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

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

Hash Join (cost=286.33..1,638.23 rows=31,630 width=52) (actual time=2.338..6.519 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.984 4.310 ↑ 1.0 6,254 1

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

  • Hash Cond: (ap.attendance_id = a.id)
7. 0.507 0.507 ↑ 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.507 rows=6,254 loops=1)

8. 0.962 1.819 ↑ 1.0 6,254 1

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

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

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

10. 0.005 0.499 ↑ 14.5 21 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
11. 0.008 0.494 ↑ 14.5 21 1

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

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

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

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

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

14. 0.001 0.340 ↑ 100.0 2 1

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

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

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

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

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

17. 0.006 0.014 ↑ 1.0 23 1

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

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

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

Planning time : 2.362 ms
Execution time : 68.769 ms