explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pYyF : Optimization for: Optimization for: plan #IfLK; plan #NO35

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 49,031.301 ↓ 0.0 0 1

Seq Scan on sungero_system_foldertag t (cost=0.00..35,448,352.04 rows=1,637,313 width=24) (actual time=49,031.301..49,031.301 rows=0 loops=1)

  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 3,274,626
2.          

SubPlan (for Seq Scan)

3. 3,274.626 49,119.390 ↓ 0.0 0 3,274,626

GroupAggregate (cost=1.85..10.81 rows=1 width=28) (actual time=0.015..0.015 rows=0 loops=3,274,626)

  • Group Key: ft.entityid, ft.folderid, ft.owner
  • Filter: (sum(COALESCE(link.id, 0)) = 0)
  • Rows Removed by Filter: 1
4. 2,049.062 45,844.764 ↑ 1.0 1 3,274,626

Nested Loop Left Join (cost=1.85..10.79 rows=1 width=28) (actual time=0.014..0.014 rows=1 loops=3,274,626)

  • Join Filter: ((link.destinationid = items.id) AND (link.destinationtypeguid = items.discriminator) AND (link.folder = folder.id))
  • Rows Removed by Join Filter: 0
5. 3,696.058 39,295.512 ↑ 1.0 1 3,274,626

Nested Loop Left Join (cost=1.42..8.12 rows=1 width=48) (actual time=0.012..0.012 rows=1 loops=3,274,626)

  • Join Filter: (folder.author = ft.owner)
6. 0.000 13,098.504 ↑ 1.0 1 3,274,626

Nested Loop Left Join (cost=1.00..5.47 rows=1 width=44) (actual time=0.004..0.004 rows=1 loops=3,274,626)

  • Join Filter: (ft.entityid = items.id)
7. 6,549.252 6,549.252 ↑ 1.0 1 3,274,626

Index Scan using nt_idx_foldertag_entity on sungero_system_foldertag ft (cost=0.43..2.67 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=3,274,626)

  • Index Cond: (entityid = t.entityid)
  • Filter: ((owner = t.owner) AND (folderid = t.folderid) AND (folderid = ANY ('{c21fa108-1570-4155-8a0c-0d04957bc72b,0d61168d-1ae5-4570-a42e-bdd5f3b07b02,669ff039-2f05-4eb3-9d6a-049dafee948f,1ead1abe-1b7e-4833-9e01-ee7f8404537a,852ea6a2-304e-48d1-88e5-1bcbb1fb69a2,a353a121-f96e-4842-8b80-bf77d074a0c2,35d23c5e-9106-4068-bc3a-46b471928fa0,a584ebf5-f9b3-4e41-b7cf-15d8c2f96844,aee5f0a0-8a5f-422f-bc40-e98db38e94ca,ae3b3ff0-73ac-4590-961c-adf4579d59de,1031e40e-2c3a-4964-92ce-92036cdcb3b9}'::uuid[])))
  • Rows Removed by Filter: 0
8. 6,750.285 6,750.285 ↑ 1.0 1 2,250,095

Index Scan using sungero_wf_assignment_pk on sungero_wf_assignment items (cost=0.57..2.79 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=2,250,095)

  • Index Cond: (id = t.entityid)
9. 22,500.950 22,500.950 ↑ 1.0 1 2,250,095

Index Scan using nt_idx_folder_name on sungero_core_folder folder (cost=0.42..2.64 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=2,250,095)

  • Index Cond: ((author = t.owner) AND (name = 'eb72a985-606c-4647-ba0c-1389928a4e17'::citext))
  • Filter: isspecial
10. 4,500.190 4,500.190 ↑ 1.0 1 2,250,095

Index Scan using idx_destinationid_destinationtypeguid on sungero_core_link link (cost=0.43..2.65 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=2,250,095)

  • Index Cond: (destinationid = t.entityid)