explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rNME

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

Nested Loop (cost=6,306.38..6,306.43 rows=1 width=16) (actual rows= loops=)

  • Join Filter: ((1) = (1))
2. 0.000 0.000 ↓ 0.0

Aggregate (cost=4,269.28..4,269.29 rows=1 width=12) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16.96..4,269.01 rows=110 width=650) (actual rows= loops=)

  • Join Filter: ((post."createdAt" > "uLogged"."createdAt") AND (("uLogged".role = ANY ('{SYSTEM_ADMINISTRATOR,ADMINISTRATOR,DESIGNER}'::enum_users_role[])) OR (post.segmentation = 'PUBLIC'::enum_posts_segmentation) OR ((post.segmentation = 'GROUP'::enum_posts_segmentation) AND (SubPlan 1)) OR ((post.segmentation = 'USER'::enum_posts_segmentation) AND (alternatives: SubPlan 2 or hashed SubPlan 3))))
4. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users "uLogged" (cost=0.29..8.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = 3080)
5. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on posts post (cost=16.68..433.49 rows=429 width=666) (actual rows= loops=)

  • Recheck Cond: ("customerCompanyId" = 46)
  • Filter: (NOT "isArchived")
6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on post_customer_arch_upd_idx (cost=0.00..16.57 rows=429 width=0) (actual rows= loops=)

  • Index Cond: (("customerCompanyId" = 46) AND ("isArchived" = false))
7.          

SubPlan (for Nested Loop)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..8.64 rows=2 width=0) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Only Scan using group_has_users_pkey on group_has_users sec_ghu_b (cost=0.29..4.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (("groupId" = post.id) AND ("userId" = "uLogged".id))
10. 0.000 0.000 ↓ 0.0

Index Only Scan using post_has_groups_pkey on post_has_groups sec_phg_a (cost=0.28..4.31 rows=2 width=4) (actual rows= loops=)

  • Index Cond: ("postId" = post.id)
11. 0.000 0.000 ↓ 0.0

Index Only Scan using post_has_users_pkey on post_has_users sec_phu_c (cost=0.28..4.29 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (("postId" = post.id) AND ("userId" = "uLogged".id))
12. 0.000 0.000 ↓ 0.0

Seq Scan on post_has_users sec_phu_c_1 (cost=0.00..9.58 rows=558 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Aggregate (cost=2,037.09..2,037.10 rows=1 width=12) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17.38..2,037.09 rows=2 width=650) (actual rows= loops=)

  • Join Filter: ((post_1."createdAt" > "uLogged_1"."createdAt") AND (("uLogged_1".role = ANY ('{SYSTEM_ADMINISTRATOR,ADMINISTRATOR,DESIGNER}'::enum_users_role[])) OR (post_1.segmentation = 'PUBLIC'::enum_posts_segmentation) OR ((post_1.segmentation = 'GROUP'::enum_posts_segmentation) AND (SubPlan 4)) OR ((post_1.segmentation = 'USER'::enum_posts_segmentation) AND (alternatives: SubPlan 5 or hashed SubPlan 6))))
15. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users "uLogged_1" (cost=0.29..8.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = 3080)
16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17.10..1,966.34 rows=7 width=666) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on posts post_1 (cost=16.68..433.49 rows=429 width=666) (actual rows= loops=)

  • Recheck Cond: ("customerCompanyId" = 46)
  • Filter: (NOT "isArchived")
18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on post_customer_arch_upd_idx (cost=0.00..16.57 rows=429 width=0) (actual rows= loops=)

  • Index Cond: (("customerCompanyId" = 46) AND ("isArchived" = false))
19. 0.000 0.000 ↓ 0.0

Index Only Scan using post_has_viewers_pkey on post_has_viewers post_view (cost=0.42..3.57 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (("postId" = post_1.id) AND ("userId" = 3080))
20.          

SubPlan (for Nested Loop)

21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..8.64 rows=2 width=0) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Only Scan using group_has_users_pkey on group_has_users sec_ghu (cost=0.29..4.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (("groupId" = post_1.id) AND ("userId" = "uLogged_1".id))
23. 0.000 0.000 ↓ 0.0

Index Only Scan using post_has_groups_pkey on post_has_groups sec_phg (cost=0.28..4.31 rows=2 width=4) (actual rows= loops=)

  • Index Cond: ("postId" = post_1.id)
24. 0.000 0.000 ↓ 0.0

Index Only Scan using post_has_users_pkey on post_has_users sec_phu (cost=0.28..4.29 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (("postId" = post_1.id) AND ("userId" = "uLogged_1".id))
25. 0.000 0.000 ↓ 0.0

Seq Scan on post_has_users sec_phu_1 (cost=0.00..9.58 rows=558 width=8) (actual rows= loops=)