explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZD3S

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=1,146,914.66..1,146,914.67 rows=1 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=1,089,014.66..1,146,908.87 rows=463 width=35) (actual rows= loops=)

  • Group Key: p.file_id
  • Filter: (sum(CASE WHEN (((p.permission_type)::text = 'user'::text) AND (hashed SubPlan 1)) THEN 0 ELSE 1 END) = 0)
3. 0.000 0.000 ↓ 0.0

Gather Merge (cost=1,089,014.66..1,144,827.44 rows=185,016 width=43) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=1,088,014.64..1,122,471.98 rows=92,508 width=43) (actual rows= loops=)

  • Group Key: p.file_id
5. 0.000 0.000 ↓ 0.0

Sort (cost=1,088,014.64..1,094,720.77 rows=2,682,453 width=51) (actual rows= loops=)

  • Sort Key: p.file_id
6. 0.000 0.000 ↓ 0.0

Parallel Hash Join (cost=166,255.08..618,222.09 rows=2,682,453 width=51) (actual rows= loops=)

  • Hash Cond: ((p.file_id)::text = (f.file_id)::text)
7. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on permission p (cost=0.00..365,605.80 rows=3,563,123 width=51) (actual rows= loops=)

  • Filter: ((role)::text <> 'owner'::text)
8. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=146,979.98..146,979.98 rows=948,888 width=35) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on file f (cost=0.00..146,979.98 rows=948,888 width=35) (actual rows= loops=)

  • Filter: (((mime_type)::text <> 'application/vnd.google-apps.folder'::text) AND (company_uuid =${Better.com companyUUID}::uuid))
10.          

SubPlan (for Partial GroupAggregate)

11. 0.000 0.000 ↓ 0.0

Seq Scan on domain (cost=0.00..1.60 rows=1 width=23) (actual rows= loops=)

  • Filter: (company_uuid = ${Better.com companyUUID}::uuid)