explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6bKu

Settings
# exclusive inclusive rows x rows loops node
1. 0.046 108.526 ↓ 2.4 348 1

Unique (cost=193,925.70..193,926.77 rows=143 width=5) (actual time=108.471..108.526 rows=348 loops=1)

2. 0.176 108.480 ↓ 2.4 348 1

Sort (cost=193,925.70..193,926.06 rows=143 width=5) (actual time=108.470..108.480 rows=348 loops=1)

  • Sort Key: org.id, ((SubPlan 1))
  • Sort Method: quicksort Memory: 41kB
3. 1.050 108.304 ↓ 2.4 348 1

Nested Loop (cost=0.53..193,920.58 rows=143 width=5) (actual time=9.305..108.304 rows=348 loops=1)

4. 9.454 9.454 ↓ 6.4 6,372 1

Function Scan on getorgtree orgtree (cost=0.25..10.25 rows=1,000 width=4) (actual time=8.522..9.454 rows=6,372 loops=1)

5. 12.488 82.836 ↓ 0.0 0 6,372

Index Scan using pk_organisation on organisation org (cost=0.28..169.97 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=6,372)

  • Index Cond: (id = orgtree.id)
  • Filter: (isactive AND (organisationroleid = 3) AND (SubPlan 2))
  • Rows Removed by Filter: 1
6.          

SubPlan (forIndex Scan)

7. 0.000 70.348 ↑ 1.0 1 1,636

Aggregate (cost=167.39..167.40 rows=1 width=1) (actual time=0.043..0.043 rows=1 loops=1,636)

8. 21.268 70.348 ↑ 1.0 1 1,636

Nested Loop (cost=0.71..167.39 rows=1 width=0) (actual time=0.039..0.043 rows=1 loops=1,636)

9. 13.088 13.088 ↓ 1.6 22 1,636

Index Scan using ix_roadworkcontract_roadworkcontractpublicspacemanagerid on roadworkcontract rc_1 (cost=0.29..49.02 rows=14 width=4) (actual time=0.002..0.008 rows=22 loops=1,636)

  • Index Cond: (roadworkcontractpublicspacemanagerid = 50)
10. 35.992 35.992 ↓ 0.0 0 35,992

Index Scan using ix_roadworkcontractowners_organisationid_roadworkcontowner on roadworkcontractowners rco_1 (cost=0.42..8.45 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=35,992)

  • Index Cond: ((organisationid = org.id) AND (roadworkcontractownerid = rc_1.id))
  • Filter: isactive
  • Rows Removed by Filter: 0
11.          

SubPlan (forNested Loop)

12. 0.348 14.964 ↑ 1.0 1 348

Aggregate (cost=167.39..167.40 rows=1 width=1) (actual time=0.043..0.043 rows=1 loops=348)

13. 4.524 14.616 ↓ 4.0 4 348

Nested Loop (cost=0.71..167.39 rows=1 width=0) (actual time=0.027..0.042 rows=4 loops=348)

14. 2.436 2.436 ↓ 1.6 22 348

Index Scan using ix_roadworkcontract_roadworkcontractpublicspacemanagerid on roadworkcontract rc (cost=0.29..49.02 rows=14 width=4) (actual time=0.002..0.007 rows=22 loops=348)

  • Index Cond: (roadworkcontractpublicspacemanagerid = 50)
15. 7.656 7.656 ↓ 0.0 0 7,656

Index Scan using ix_roadworkcontractowners_organisationid_roadworkcontowner on roadworkcontractowners rco (cost=0.42..8.45 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=7,656)

  • Index Cond: ((organisationid = org.id) AND (roadworkcontractownerid = rc.id))
  • Filter: isactive
  • Rows Removed by Filter: 0
Planning time : 2.530 ms