explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KlvF

Settings
# exclusive inclusive rows x rows loops node
1. 0.124 2.753 ↓ 2.2 270 1

Nested Loop (cost=319.53..578.14 rows=125 width=10) (actual time=1.166..2.753 rows=270 loops=1)

2.          

CTE children

3. 0.124 0.457 ↓ 1.9 45 1

Bitmap Heap Scan on fs_node (cost=4.48..92.82 rows=24 width=4) (actual time=0.350..0.457 rows=45 loops=1)

  • Recheck Cond: (path ~ '1.599.1587.5728.5730.5733.*{1}'::lquery)
  • Filter: (archived_at IS NULL)
  • Heap Blocks: exact=45
4. 0.333 0.333 ↓ 1.7 45 1

Bitmap Index Scan on path_gist_idx (cost=0.00..4.47 rows=26 width=0) (actual time=0.333..0.333 rows=45 loops=1)

  • Index Cond: (path ~ '1.599.1587.5728.5730.5733.*{1}'::lquery)
5.          

CTE view_permissions_node_ids

6. 0.044 1.079 ↓ 2.0 45 1

Nested Loop (cost=1.39..225.37 rows=22 width=4) (actual time=0.552..1.079 rows=45 loops=1)

7. 0.064 0.810 ↓ 1.9 45 1

Nested Loop (cost=0.96..203.36 rows=24 width=8) (actual time=0.532..0.810 rows=45 loops=1)

8. 0.040 0.521 ↓ 1.9 45 1

HashAggregate (cost=0.54..0.78 rows=24 width=4) (actual time=0.506..0.521 rows=45 loops=1)

  • Group Key: children.id
9. 0.481 0.481 ↓ 1.9 45 1

CTE Scan on children (cost=0.00..0.48 rows=24 width=4) (actual time=0.353..0.481 rows=45 loops=1)

10. 0.225 0.225 ↑ 1.0 1 45

Index Scan using fs_permission_node_id_access_right_81ac3a0e_uniq on fs_permission fs_permission_1 (cost=0.42..8.44 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=45)

  • Index Cond: ((node_id = children.id) AND ((access_right)::text = 'view'::text))
11. 0.225 0.225 ↑ 1.0 1 45

Index Only Scan using fs_userpermission_user_id_permission_id_baa0e460_uniq on fs_userpermission fs_userpermission_1 (cost=0.43..0.92 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=45)

  • Index Cond: ((user_id = 178) AND (permission_id = fs_permission_1.id))
  • Heap Fetches: 33
12. 0.116 1.549 ↓ 2.0 270 1

Nested Loop (cost=0.92..190.14 rows=133 width=14) (actual time=1.156..1.549 rows=270 loops=1)

13. 0.053 1.163 ↓ 2.0 45 1

HashAggregate (cost=0.49..0.71 rows=22 width=4) (actual time=1.140..1.163 rows=45 loops=1)

  • Group Key: view_permissions_node_ids.node_id
14. 1.110 1.110 ↓ 2.0 45 1

CTE Scan on view_permissions_node_ids (cost=0.00..0.44 rows=22 width=4) (actual time=0.555..1.110 rows=45 loops=1)

15. 0.270 0.270 ↑ 1.0 6 45

Index Scan using fs_permission_node_id_638e8a2b on fs_permission (cost=0.42..8.55 rows=6 width=14) (actual time=0.004..0.006 rows=6 loops=45)

  • Index Cond: (node_id = view_permissions_node_ids.node_id)
16. 1.080 1.080 ↑ 1.0 1 270

Index Only Scan using fs_userpermission_user_id_permission_id_baa0e460_uniq on fs_userpermission (cost=0.43..0.52 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=270)

  • Index Cond: ((user_id = 178) AND (permission_id = fs_permission.id))
  • Heap Fetches: 198
Planning time : 1.128 ms
Execution time : 2.938 ms