explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nnOu

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 168.203 ↑ 7.4 27 1

Unique (cost=6,484.98..6,487.48 rows=200 width=33) (actual time=168.190..168.203 rows=27 loops=1)

2. 0.162 168.192 ↑ 2.4 84 1

Sort (cost=6,484.98..6,485.48 rows=200 width=33) (actual time=168.189..168.192 rows=84 loops=1)

  • Sort Key: mem.approved, u.email, u.firstname, u.organisationid
  • Sort Method: quicksort Memory: 31kB
3. 0.029 168.030 ↑ 2.4 84 1

Nested Loop (cost=840.07..6,477.33 rows=200 width=33) (actual time=18.283..168.030 rows=84 loops=1)

4. 4.745 167.973 ↓ 1.4 28 1

Nested Loop (cost=839.64..6,465.75 rows=20 width=37) (actual time=18.254..167.973 rows=28 loops=1)

  • Join Filter: (SubPlan 1)
  • Rows Removed by Join Filter: 926
5. 0.008 0.008 ↑ 1.0 1 1

Index Scan using pk_request on roadworkrequest r (cost=0.43..8.45 rows=1 width=24) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (id = 1243203)
  • Filter: (roadworkstatustypeid = 10)
6. 0.192 22.028 ↓ 23.9 954 1

Nested Loop (cost=839.21..1,816.80 rows=40 width=41) (actual time=6.720..22.028 rows=954 loops=1)

7. 0.581 19.920 ↓ 19.2 958 1

Nested Loop (cost=838.93..1,752.77 rows=50 width=37) (actual time=6.713..19.920 rows=958 loops=1)

8. 4.348 15.094 ↓ 3.2 1,415 1

Hash Join (cost=838.64..1,349.92 rows=443 width=37) (actual time=6.685..15.094 rows=1,415 loops=1)

  • Hash Cond: ((mem.user_id)::text = (u.aspmembershipid)::text)
9. 4.105 4.105 ↑ 1.0 10,209 1

Seq Scan on users mem (cost=0.00..443.05 rows=10,209 width=17) (actual time=0.020..4.105 rows=10,209 loops=1)

  • Filter: approved
  • Rows Removed by Filter: 1996
10. 0.380 6.641 ↓ 1.3 1,557 1

Hash (cost=823.85..823.85 rows=1,183 width=73) (actual time=6.641..6.641 rows=1,557 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 183kB
11. 6.261 6.261 ↓ 1.3 1,557 1

Seq Scan on "user" u (cost=0.00..823.85 rows=1,183 width=73) (actual time=0.017..6.261 rows=1,557 loops=1)

  • Filter: (isroadworksinvolvedenabled AND (NOT isdeleted))
  • Rows Removed by Filter: 25728
12. 4.245 4.245 ↑ 1.0 1 1,415

Index Only Scan using user_id_roadworkstatustype_id_unique on useremailnotification n (cost=0.29..0.91 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1,415)

  • Index Cond: ((userid = u.id) AND (roadworkstatustypeid = 10))
  • Heap Fetches: 958
13. 1.916 1.916 ↑ 1.0 1 958

Index Scan using pk_organisation on organisation o (cost=0.28..1.28 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=958)

  • Index Cond: (id = u.organisationid)
  • Filter: emailenabled
  • Rows Removed by Filter: 0
14.          

SubPlan (forNested Loop)

15. 16.218 141.192 ↑ 571.4 7 954

HashAggregate (cost=91.00..131.00 rows=4,000 width=4) (actual time=0.135..0.148 rows=7 loops=954)

  • Group Key: getparentorgtree.id
16. 1.908 124.974 ↑ 571.4 7 954

Append (cost=0.25..81.00 rows=4,000 width=4) (actual time=0.038..0.131 rows=7 loops=954)

17. 36.252 36.252 ↑ 333.3 3 954

Function Scan on getparentorgtree (cost=0.25..10.25 rows=1,000 width=4) (actual time=0.038..0.038 rows=3 loops=954)

18. 32.436 32.436 ↑ 500.0 2 954

Function Scan on getparentorgtree getparentorgtree_1 (cost=0.25..10.25 rows=1,000 width=4) (actual time=0.034..0.034 rows=2 loops=954)

19. 23.850 23.850 ↓ 0.0 0 954

Function Scan on getparentorgtree getparentorgtree_2 (cost=0.25..10.25 rows=1,000 width=4) (actual time=0.025..0.025 rows=0 loops=954)

20. 30.528 30.528 ↑ 500.0 2 954

Function Scan on getparentorgtree getparentorgtree_3 (cost=0.25..10.25 rows=1,000 width=4) (actual time=0.032..0.032 rows=2 loops=954)

21. 0.003 0.028 ↑ 3.3 3 28

Materialize (cost=0.44..9.11 rows=10 width=4) (actual time=0.001..0.001 rows=3 loops=28)

22. 0.025 0.025 ↑ 3.3 3 1

Index Only Scan using ix_roadworkrequesthistory_roadworkrequestid on roadworkrequesthistory rrh (cost=0.44..9.06 rows=10 width=4) (actual time=0.024..0.025 rows=3 loops=1)

  • Index Cond: (roadworkrequestid = 1243203)
  • Heap Fetches: 3
Planning time : 1.190 ms