explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tcj9

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

Nested Loop (cost=26,997.71..26,999.97 rows=1 width=148) (actual rows= loops=)

2.          

CTE children

3. 0.000 0.000 ↓ 0.0

Recursive Union (cost=0.57..26,935.38 rows=21 width=48) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Index Scan using file_pkey on file file_1 (cost=0.57..2.79 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (id = '2265356042'::bigint)
  • Filter: (deleted_at IS NULL)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=896.54..2,693.22 rows=2 width=48) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

WorkTable Scan on children children_1 (cost=0.00..0.22 rows=3 width=48) (actual rows= loops=)

  • Filter: (level < 32)
7. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on file file_2 (cost=896.54..897.65 rows=1 width=39) (actual rows= loops=)

  • Recheck Cond: ((parent_id = children_1.id) AND (deleted_at IS NULL) AND (owner_id = children_1.owner_id))
8. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=896.54..896.54 rows=1 width=0) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_file_cmp_dnd (cost=0.00..144.54 rows=3,568 width=0) (actual rows= loops=)

  • Index Cond: ((parent_id = children_1.id) AND (deleted_at IS NULL))
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_file_owner_id (cost=0.00..751.75 rows=42,810 width=0) (actual rows= loops=)

  • Index Cond: (owner_id = children_1.owner_id)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=62.19..64.43 rows=1 width=120) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Sort (cost=61.62..61.63 rows=1 width=116) (actual rows= loops=)

  • Sort Key: children.level
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.15..61.61 rows=1 width=116) (actual rows= loops=)

  • Join Filter: (children.id = file.id)
14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..59.27 rows=1 width=52) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

CTE Scan on children (cost=0.00..0.42 rows=21 width=44) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan using file_access_pkey on file_access (cost=0.57..2.80 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (file_id = children.id)
  • Filter: ((((acl ->> '0'::text))::integer & 1) = 1)
17. 0.000 0.000 ↓ 0.0

Index Scan using file_pkey on file (cost=0.57..2.33 rows=1 width=80) (actual rows= loops=)

  • Index Cond: (id = file_access.file_id)
18. 0.000 0.000 ↓ 0.0

Index Scan using storage_file_pkey on storage_file (cost=0.57..2.79 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id = file.storage_file_id)
19. 0.000 0.000 ↓ 0.0

Index Scan using storage_pkey on storage (cost=0.14..0.16 rows=1 width=548) (actual rows= loops=)

  • Index Cond: (id = storage_file.storage_id)