explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tjDA

Settings
# exclusive inclusive rows x rows loops node
1. 0.049 30.727 ↓ 33.7 337 1

Append (cost=4.59..303.70 rows=10 width=205) (actual time=1.415..30.727 rows=337 loops=1)

2. 0.006 1.415 ↑ 2.0 1 1

Nested Loop (cost=4.59..40.51 rows=2 width=206) (actual time=1.414..1.415 rows=1 loops=1)

3. 0.006 1.398 ↑ 3.0 1 1

Bitmap Heap Scan on compliment c (cost=4.31..15.60 rows=3 width=186) (actual time=1.397..1.398 rows=1 loops=1)

  • Recheck Cond: (complimentee = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
  • Heap Blocks: exact=1
4. 1.392 1.392 ↑ 3.0 1 1

Bitmap Index Scan on complimentee_fk (cost=0.00..4.31 rows=3 width=0) (actual time=1.392..1.392 rows=1 loops=1)

  • Index Cond: (complimentee = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
5. 0.011 0.011 ↑ 1.0 1 1

Index Scan using user_pkey on "user" (cost=0.29..8.30 rows=1 width=88) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (id = c.complimenter)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
6. 0.001 1.361 ↓ 0.0 0 1

Nested Loop (cost=4.88..60.72 rows=1 width=154) (actual time=1.361..1.361 rows=0 loops=1)

7. 0.000 1.360 ↓ 0.0 0 1

Nested Loop (cost=4.60..52.41 rows=1 width=134) (actual time=1.360..1.360 rows=0 loops=1)

8. 0.001 1.360 ↓ 0.0 0 1

Bitmap Heap Scan on compliment c_1 (cost=4.32..19.21 rows=4 width=48) (actual time=1.360..1.360 rows=0 loops=1)

  • Recheck Cond: (complimenter = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
9. 1.359 1.359 ↓ 0.0 0 1

Bitmap Index Scan on complimenter_fk (cost=0.00..4.32 rows=4 width=0) (actual time=1.359..1.359 rows=0 loops=1)

  • Index Cond: (complimenter = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
10. 0.000 0.000 ↓ 0.0 0

Index Scan using compliment_reaction_pkey on compliment_reaction cr (cost=0.28..8.30 rows=1 width=102) (never executed)

  • Index Cond: (compliment_id = c_1.id)
11. 0.000 0.000 ↓ 0.0 0

Index Scan using user_pkey on "user" user_1 (cost=0.29..8.30 rows=1 width=88) (never executed)

  • Index Cond: (id = c_1.complimentee)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
12. 0.001 1.134 ↓ 0.0 0 1

GroupAggregate (cost=31.61..31.63 rows=1 width=135) (actual time=1.134..1.134 rows=0 loops=1)

  • Group Key: g.id, gc.seen
13. 0.007 1.133 ↓ 0.0 0 1

Sort (cost=31.61..31.61 rows=1 width=187) (actual time=1.133..1.133 rows=0 loops=1)

  • Sort Key: g.id, gc.seen
  • Sort Method: quicksort Memory: 25kB
14. 0.000 1.126 ↓ 0.0 0 1

Nested Loop (cost=4.86..31.60 rows=1 width=187) (actual time=1.126..1.126 rows=0 loops=1)

15. 0.000 1.126 ↓ 0.0 0 1

Nested Loop (cost=4.58..28.39 rows=1 width=115) (actual time=1.126..1.126 rows=0 loops=1)

16. 0.001 1.126 ↓ 0.0 0 1

Bitmap Heap Scan on goal g (cost=4.30..11.79 rows=2 width=83) (actual time=1.126..1.126 rows=0 loops=1)

  • Recheck Cond: (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
17. 1.125 1.125 ↓ 0.0 0 1

Bitmap Index Scan on goal_user_id_fk (cost=0.00..4.30 rows=2 width=0) (actual time=1.125..1.125 rows=0 loops=1)

  • Index Cond: (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using goal_comment_goal_id_fk on goal_comment gc (cost=0.28..8.29 rows=1 width=48) (never executed)

  • Index Cond: (goal_id = g.id)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using user_pkey on "user" user_2 (cost=0.29..3.20 rows=1 width=88) (never executed)

  • Index Cond: (id = gc.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
20. 0.000 0.746 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.18..53.68 rows=1 width=225) (actual time=0.746..0.746 rows=0 loops=1)

  • Filter: (ahrv.id IS NULL)
21. 0.001 0.746 ↓ 0.0 0 1

Nested Loop (cost=4.89..45.36 rows=1 width=277) (actual time=0.746..0.746 rows=0 loops=1)

22. 0.002 0.745 ↓ 0.0 0 1

Nested Loop (cost=4.60..40.33 rows=1 width=205) (actual time=0.745..0.745 rows=0 loops=1)

23. 0.004 0.274 ↑ 3.0 1 1

Bitmap Heap Scan on ad_hoc_request ahr (cost=4.32..15.34 rows=3 width=56) (actual time=0.274..0.274 rows=1 loops=1)

  • Recheck Cond: ((user_id IS NOT NULL) AND (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid))
  • Filter: (denied IS NULL)
  • Heap Blocks: exact=1
24. 0.270 0.270 ↑ 3.0 1 1

Bitmap Index Scan on ad_hoc_request_user_id_fk (cost=0.00..4.32 rows=3 width=0) (actual time=0.270..0.270 rows=1 loops=1)

  • Index Cond: ((user_id IS NOT NULL) AND (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid))
25. 0.469 0.469 ↓ 0.0 0 1

Index Scan using ad_hoc_request_group_pkey on ad_hoc_request_group ahg (cost=0.29..8.31 rows=1 width=181) (actual time=0.469..0.469 rows=0 loops=1)

  • Index Cond: (id = ahr.ad_hoc_request_group_id)
  • Filter: (expires > now())
  • Rows Removed by Filter: 1
26. 0.000 0.000 ↓ 0.0 0

Index Scan using user_pkey on "user" user_3 (cost=0.29..5.03 rows=1 width=88) (never executed)

  • Index Cond: (id = ahg.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
27. 0.000 0.000 ↓ 0.0 0

Index Scan using ad_hoc_review_ad_hoc_request_id_key on ad_hoc_review ahrv (cost=0.29..8.30 rows=1 width=32) (never executed)

  • Index Cond: (ad_hoc_request_id = ahr.id)
28. 0.662 25.497 ↓ 84.0 336 1

Nested Loop (cost=9.19..66.92 rows=4 width=225) (actual time=3.232..25.497 rows=336 loops=1)

29. 0.141 23.827 ↓ 84.0 336 1

Nested Loop Left Join (cost=8.90..64.75 rows=4 width=284) (actual time=2.742..23.827 rows=336 loops=1)

  • Filter: ((ahr_1.user_id IS NULL) = (user_4.id IS NULL))
  • Rows Removed by Filter: 56
30. 0.146 4.478 ↓ 49.0 392 1

Nested Loop (cost=8.62..61.46 rows=8 width=212) (actual time=2.725..4.478 rows=392 loops=1)

31. 0.007 2.256 ↓ 2.0 6 1

Bitmap Heap Scan on ad_hoc_request_group ahg_1 (cost=4.31..15.38 rows=3 width=173) (actual time=2.255..2.256 rows=6 loops=1)

  • Recheck Cond: (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
  • Heap Blocks: exact=1
32. 2.249 2.249 ↓ 2.0 6 1

Bitmap Index Scan on ad_hoc_request_group_user_id_fk (cost=0.00..4.31 rows=3 width=0) (actual time=2.249..2.249 rows=6 loops=1)

  • Index Cond: (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid)
33. 0.108 2.076 ↓ 21.7 65 6

Bitmap Heap Scan on ad_hoc_request ahr_1 (cost=4.31..15.33 rows=3 width=71) (actual time=0.335..0.346 rows=65 loops=6)

  • Recheck Cond: (ad_hoc_request_group_id = ahg_1.id)
  • Heap Blocks: exact=10
34. 1.968 1.968 ↓ 21.7 65 6

Bitmap Index Scan on ad_hoc_request_group_id_email_uk (cost=0.00..4.31 rows=3 width=0) (actual time=0.328..0.328 rows=65 loops=6)

  • Index Cond: (ad_hoc_request_group_id = ahg_1.id)
35. 19.208 19.208 ↑ 1.0 1 392

Index Scan using user_pkey on "user" user_4 (cost=0.29..0.40 rows=1 width=88) (actual time=0.049..0.049 rows=1 loops=392)

  • Index Cond: (id = ahr_1.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
  • Rows Removed by Filter: 0
36. 1.008 1.008 ↑ 1.0 1 336

Index Scan using ad_hoc_review_ad_hoc_request_id_key on ad_hoc_review ahrv_1 (cost=0.29..0.54 rows=1 width=48) (actual time=0.003..0.003 rows=1 loops=336)

  • Index Cond: (ad_hoc_request_id = ahr_1.id)
37. 0.000 0.525 ↓ 0.0 0 1

Nested Loop (cost=5.46..50.09 rows=1 width=225) (actual time=0.525..0.525 rows=0 loops=1)

38. 0.001 0.525 ↓ 0.0 0 1

Nested Loop (cost=5.17..49.54 rows=1 width=205) (actual time=0.525..0.525 rows=0 loops=1)

39. 0.001 0.524 ↓ 0.0 0 1

Nested Loop (cost=4.89..41.24 rows=1 width=64) (actual time=0.524..0.524 rows=0 loops=1)

40. 0.004 0.016 ↑ 3.0 1 1

Nested Loop (cost=4.61..40.25 rows=3 width=48) (actual time=0.015..0.016 rows=1 loops=1)

41. 0.002 0.007 ↑ 3.0 1 1

Bitmap Heap Scan on ad_hoc_request ahr_2 (cost=4.32..15.34 rows=3 width=48) (actual time=0.006..0.007 rows=1 loops=1)

  • Recheck Cond: ((user_id IS NOT NULL) AND (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid))
  • Heap Blocks: exact=1
42. 0.005 0.005 ↑ 3.0 1 1

Bitmap Index Scan on ad_hoc_request_user_id_fk (cost=0.00..4.32 rows=3 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: ((user_id IS NOT NULL) AND (user_id = 'c2278e3e-3328-419d-b8c9-9b384fa9529c'::uuid))
43. 0.005 0.005 ↑ 1.0 1 1

Index Scan using ad_hoc_review_ad_hoc_request_id_key on ad_hoc_review ahrv_2 (cost=0.29..8.30 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (ad_hoc_request_id = ahr_2.id)
44. 0.507 0.507 ↓ 0.0 0 1

Index Scan using ad_hoc_review_reaction_pkey on ad_hoc_review_reaction ahrvr (cost=0.28..0.33 rows=1 width=32) (actual time=0.507..0.507 rows=0 loops=1)

  • Index Cond: (ad_hoc_review_id = ahrv_2.id)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using ad_hoc_request_group_pkey on ad_hoc_request_group ahg_2 (cost=0.29..8.30 rows=1 width=173) (never executed)

  • Index Cond: (id = ahr_2.ad_hoc_request_group_id)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using user_pkey on "user" user_5 (cost=0.29..0.55 rows=1 width=88) (never executed)

  • Index Cond: (id = ahg_2.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
Planning time : 5.002 ms
Execution time : 38.972 ms