explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yDhh

Settings
# exclusive inclusive rows x rows loops node
1. 47.918 89,933.104 ↓ 6,666.0 6,666 1

Nested Loop Semi Join (cost=2.01..26.21 rows=1 width=34) (actual time=195.663..89,933.104 rows=6,666 loops=1)

2. 133.234 480.386 ↓ 133,440.0 133,440 1

Nested Loop (cost=0.86..16.89 rows=1 width=34) (actual time=0.058..480.386 rows=133,440 loops=1)

3. 80.272 80.272 ↓ 133,440.0 133,440 1

Index Scan using fs_userpermission_user_id_permission_id_baa0e460_uniq on fs_userpermission (cost=0.43..8.45 rows=1 width=20) (actual time=0.033..80.272 rows=133,440 loops=1)

  • Index Cond: (user_id = 1239)
4. 266.880 266.880 ↑ 1.0 1 133,440

Index Scan using fs_permission_pkey on fs_permission (cost=0.42..8.44 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=133,440)

  • Index Cond: (id = fs_userpermission.permission_id)
5. 14,391.942 89,404.800 ↓ 0.0 0 133,440

Nested Loop (cost=1.15..9.30 rows=1 width=8) (actual time=0.670..0.670 rows=0 loops=133,440)

  • Join Filter: (u1.id = u2.permission_id)
  • Rows Removed by Join Filter: 1348
6. 0.000 400.320 ↓ 0.0 0 133,440

Nested Loop (cost=0.72..0.84 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=133,440)

  • Join Filter: (u0.id = u1.node_id)
7. 400.320 400.320 ↓ 0.0 0 133,440

Index Scan using fs_node_pkey on fs_node u0 (cost=0.29..0.34 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=133,440)

  • Index Cond: (id = fs_permission.node_id)
  • Filter: ((archived_at IS NULL) AND (path ~ '1.402.403.5261.40005.40006.40009.44636.*{1}'::lquery))
  • Rows Removed by Filter: 1
8. 33.330 33.330 ↑ 1.0 1 6,666

Index Scan using fs_permission_node_id_access_right_81ac3a0e_uniq on fs_permission u1 (cost=0.42..0.48 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=6,666)

  • Index Cond: ((node_id = fs_permission.node_id) AND ((access_right)::text = 'view'::text))
9. 74,612.538 74,612.538 ↓ 26,990.0 26,990 6,666

Index Only Scan using fs_userpermission_user_id_permission_id_baa0e460_uniq on fs_userpermission u2 (cost=0.43..8.45 rows=1 width=4) (actual time=0.009..11.193 rows=26,990 loops=6,666)

  • Index Cond: (user_id = 1239)
  • Heap Fetches: 179914476
Planning time : 2.295 ms
Execution time : 89,934.326 ms