explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2b6a

Settings
# exclusive inclusive rows x rows loops node
1. 49.682 686.761 ↓ 1.0 4,647 1

GroupAggregate (cost=3,991.08..5,325.48 rows=4,448 width=776) (actual time=635.450..686.761 rows=4,647 loops=1)

  • Group Key: ahgg.goal_id, ahrv.id, "user".id, ahg.question, ahg.created, ahg.user_id, ahg.public_goal, ahr.user_id, ahr.external_email
2. 24.523 637.079 ↓ 1.4 6,445 1

Sort (cost=3,991.08..4,002.20 rows=4,448 width=739) (actual time=634.679..637.079 rows=6,445 loops=1)

  • Sort Key: ahgg.goal_id, ahrv.id, "user".id, ahg.question, ahg.created, ahg.user_id, ahg.public_goal, ahr.user_id, ahr.external_email
  • Sort Method: external merge Disk: 5064kB
3. 3.023 612.556 ↓ 1.4 6,445 1

Hash Right Join (cost=3,495.68..3,721.56 rows=4,448 width=739) (actual time=609.236..612.556 rows=6,445 loops=1)

  • Hash Cond: (gs.goal_id = ahgg.goal_id)
4. 0.780 0.780 ↑ 1.0 3,784 1

Seq Scan on goal_share gs (cost=0.00..76.24 rows=3,824 width=32) (actual time=0.017..0.780 rows=3,784 loops=1)

5. 5.373 608.753 ↓ 2.2 5,232 1

Hash (cost=3,466.58..3,466.58 rows=2,328 width=723) (actual time=608.753..608.753 rows=5,232 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 3906kB
6. 4.743 603.380 ↓ 2.2 5,232 1

Hash Join (cost=3,043.04..3,466.58 rows=2,328 width=723) (actual time=561.046..603.380 rows=5,232 loops=1)

  • Hash Cond: (ahg.id = ahgg.ad_hoc_request_group_id)
7. 38.068 38.068 ↑ 1.0 9,477 1

Seq Scan on ad_hoc_request_group ahg (cost=0.00..364.84 rows=9,584 width=182) (actual time=0.026..38.068 rows=9,477 loops=1)

8. 3.986 560.569 ↓ 2.3 5,232 1

Hash (cost=3,014.59..3,014.59 rows=2,276 width=589) (actual time=560.569..560.569 rows=5,232 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 3121kB
9. 3.447 556.583 ↓ 2.3 5,232 1

Hash Right Join (cost=2,887.56..3,014.59 rows=2,276 width=589) (actual time=552.104..556.583 rows=5,232 loops=1)

  • Hash Cond: (ahrs.ad_hoc_review_id = ahrv.id)
10. 1.944 1.944 ↑ 1.0 5,164 1

Seq Scan on ad_hoc_review_share ahrs (cost=0.00..102.64 rows=5,164 width=32) (actual time=0.012..1.944 rows=5,164 loops=1)

11. 29.414 551.192 ↓ 2.0 4,647 1

Hash (cost=2,859.11..2,859.11 rows=2,276 width=573) (actual time=551.192..551.192 rows=4,647 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 2742kB
12. 5.599 521.778 ↓ 2.0 4,647 1

Nested Loop (cost=904.15..2,859.11 rows=2,276 width=573) (actual time=17.673..521.778 rows=4,647 loops=1)

13. 5.022 150.583 ↓ 1.9 4,748 1

Hash Join (cost=903.86..1,537.65 rows=2,462 width=191) (actual time=17.093..150.583 rows=4,748 loops=1)

  • Hash Cond: (ahr.ad_hoc_request_group_id = ahgg.ad_hoc_request_group_id)
14. 11.130 136.390 ↓ 1.8 22,981 1

Hash Left Join (cost=844.98..1,406.67 rows=12,660 width=159) (actual time=7.902..136.390 rows=22,981 loops=1)

  • Hash Cond: (ahr.user_id = "user".id)
  • Filter: ((ahr.user_id IS NULL) = ("user".id IS NULL))
  • Rows Removed by Filter: 1503
15. 117.808 117.808 ↑ 1.0 24,484 1

Seq Scan on ad_hoc_request ahr (cost=0.00..495.21 rows=25,321 width=71) (actual time=0.427..117.808 rows=24,484 loops=1)

16. 3.588 7.452 ↑ 1.0 12,172 1

Hash (cost=692.83..692.83 rows=12,172 width=88) (actual time=7.452..7.452 rows=12,172 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1566kB
17. 3.864 3.864 ↑ 1.0 12,172 1

Seq Scan on "user" (cost=0.00..692.83 rows=12,172 width=88) (actual time=0.009..3.864 rows=12,172 loops=1)

  • Filter: (status = ANY ('{invited,active}'::user_status[]))
  • Rows Removed by Filter: 3574
18. 1.405 9.171 ↑ 1.0 1,818 1

Hash (cost=35.06..35.06 rows=1,906 width=32) (actual time=9.171..9.171 rows=1,818 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 130kB
19. 7.766 7.766 ↑ 1.0 1,818 1

Seq Scan on ad_hoc_request_goal ahgg (cost=0.00..35.06 rows=1,906 width=32) (actual time=0.893..7.766 rows=1,818 loops=1)

20. 365.596 365.596 ↑ 1.0 1 4,748

Index Scan using ad_hoc_review_ad_hoc_request_id_key on ad_hoc_review ahrv (cost=0.29..0.54 rows=1 width=414) (actual time=0.077..0.077 rows=1 loops=4,748)

  • Index Cond: (ad_hoc_request_id = ahr.id)
Planning time : 19.632 ms
Execution time : 691.821 ms