explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SNBY

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.129 ↓ 0.0 0 1

Unique (cost=3,162.28..3,164.64 rows=189 width=37) (actual time=0.129..0.129 rows=0 loops=1)

2. 0.070 0.128 ↓ 0.0 0 1

Sort (cost=3,162.28..3,162.75 rows=189 width=37) (actual time=0.128..0.128 rows=0 loops=1)

  • Sort Key: mem.approved, u.email, u.firstname, u.organisationid
  • Sort Method: quicksort Memory: 25kB
3. 0.000 0.058 ↓ 0.0 0 1

Nested Loop (cost=2,287.74..3,155.13 rows=189 width=37) (actual time=0.058..0.058 rows=0 loops=1)

4. 0.001 0.058 ↓ 0.0 0 1

Hash Join (cost=2,287.31..3,148.16 rows=21 width=41) (actual time=0.058..0.058 rows=0 loops=1)

  • Hash Cond: (u.organisationid = o.id)
  • Join Filter: (SubPlan 1)
5. 0.000 0.057 ↓ 0.0 0 1

Nested Loop (cost=917.23..1,777.94 rows=52 width=57) (actual time=0.057..0.057 rows=0 loops=1)

6. 0.057 0.057 ↓ 0.0 0 1

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

  • Index Cond: (id = 1243203)
  • Filter: (roadworkstatustypeid = 10)
  • Rows Removed by Filter: 1
7. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=916.80..1,768.97 rows=52 width=41) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=916.52..1,534.04 rows=458 width=41) (never executed)

  • Hash Cond: ((mem.user_id)::text = (u.aspmembershipid)::text)
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on users mem (cost=0.00..546.52 rows=10,628 width=17) (never executed)

  • Filter: approved
10. 0.000 0.000 ↓ 0.0 0

Hash (cost=900.94..900.94 rows=1,246 width=77) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on "user" u (cost=0.00..900.94 rows=1,246 width=77) (never executed)

  • Filter: (isroadworksinvolvedenabled AND (NOT isdeleted))
12. 0.000 0.000 ↓ 0.0 0

Index Only Scan using user_id_roadworkstatustype_id_unique on useremailnotification n (cost=0.29..0.51 rows=1 width=8) (never executed)

  • Index Cond: ((userid = u.id) AND (roadworkstatustypeid = 10))
  • Heap Fetches: 0
13. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,303.64..1,303.64 rows=5,315 width=4) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Seq Scan on organisation o (cost=0.00..1,303.64 rows=5,315 width=4) (never executed)

  • Filter: emailenabled
15.          

SubPlan (forHash Join)

16. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=91.00..131.00 rows=4,000 width=4) (never executed)

  • Group Key: getparentorgtree.id
17. 0.000 0.000 ↓ 0.0 0

Append (cost=0.25..81.00 rows=4,000 width=4) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Function Scan on getparentorgtree (cost=0.25..10.25 rows=1,000 width=4) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Function Scan on getparentorgtree getparentorgtree_1 (cost=0.25..10.25 rows=1,000 width=4) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Function Scan on getparentorgtree getparentorgtree_2 (cost=0.25..10.25 rows=1,000 width=4) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Function Scan on getparentorgtree getparentorgtree_3 (cost=0.25..10.25 rows=1,000 width=4) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.43..4.64 rows=9 width=4) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ix_roadworkrequesthistory on roadworkrequesthistory rrh (cost=0.43..4.59 rows=9 width=4) (never executed)

  • Index Cond: (roadworkrequestid = 1243203)
  • Heap Fetches: 0
Planning time : 4.665 ms