explain.depesz.com

PostgreSQL's explain analyze made readable

Result: svST

Settings
# exclusive inclusive rows x rows loops node
1. 0.263 51.799 ↑ 1.0 10 1

Limit (cost=15,791.48..15,791.58 rows=10 width=20) (actual time=51.796..51.799 rows=10 loops=1)

2. 11.862 51.536 ↑ 3.8 10,010 1

HashAggregate (cost=15,691.48..16,073.58 rows=38,210 width=20) (actual time=50.008..51.536 rows=10,010 loops=1)

  • Group Key: f.id
3. 14.821 39.674 ↑ 5.0 37,579 1

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

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

5. 1.492 10.228 ↑ 5.2 6,087 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 566kB
6. 2.141 8.736 ↑ 5.2 6,087 1

Hash Join (cost=286.33..1,638.23 rows=31,630 width=52) (actual time=3.468..8.736 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))
7. 2.520 6.063 ↑ 1.0 6,254 1

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

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

9. 1.554 2.896 ↑ 1.0 6,254 1

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

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

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

11. 0.006 0.532 ↑ 14.5 21 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.012 0.526 ↑ 14.5 21 1

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

  • Hash Cond: (racl.registry_id = r.id)
13. 0.080 0.499 ↑ 14.5 21 1

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

  • Hash Cond: (racl.trustee_id = get_trustee_list.trustee_id)
14. 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)

15. 0.001 0.376 ↑ 100.0 2 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.005 0.375 ↑ 100.0 2 1

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

  • Group Key: get_trustee_list.trustee_id
17. 0.370 0.370 ↑ 500.0 2 1

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

18. 0.006 0.015 ↑ 1.0 23 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
19. 0.009 0.009 ↑ 1.0 23 1

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

Planning time : 3.329 ms
Execution time : 52.405 ms