explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rSsZ

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

Nested Loop Left Join (cost=15.36..161.70 rows=1 width=8) (actual rows= loops=)

  • Filter: (COALESCE(CASE WHEN ((defaultemailprefs_2.action = ANY ('{3,17,74,70,71}'::integer[])) OR (useremailprefs_3.preference = 4)) THEN COALESCE(useremailprefs_2.preference, defaultemailprefs_2.preference) ELSE useremailprefs_3.preference END, CASE WHE (...)
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14.94..127.85 rows=4 width=32) (actual rows= loops=)

  • Join Filter: (defaultemailprefs_3.action = defaultemailprefs_2.action)
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14.52..94.05 rows=4 width=28) (actual rows= loops=)

  • Join Filter: (useremailprefs_5.groupid = invites.ownerid)
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10.07..81.63 rows=4 width=24) (actual rows= loops=)

  • Join Filter: ((useremailprefs_4.groupid = invites.ownerid) AND (useremailprefs_4.action = defaultemailprefs_2.action))
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=5.60..49.70 rows=4 width=20) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.31..41.34 rows=4 width=16) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.84..17.19 rows=1 width=12) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using ix_defaultemailprefs_action on defaultemailprefs defaultemailprefs_2 (cost=0.42..8.73 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (action IS NOT NULL)
  • Filter: ((groupid IS NULL) AND (orgid IS NULL))
9. 0.000 0.000 ↓ 0.0

Index Scan using useremailprefs_userid_action_groupidnull_unique on useremailprefs useremailprefs_2 (cost=0.42..8.44 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((userid = 943004921) AND (action = defaultemailprefs_2.action))
10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on invites (cost=4.46..24.12 rows=4 width=4) (actual rows= loops=)

  • Recheck Cond: (userid = 943004921)
  • Filter: (status = 1)
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_invites_userid (cost=0.00..4.46 rows=5 width=0) (actual rows= loops=)

  • Index Cond: (userid = 943004921)
12. 0.000 0.000 ↓ 0.0

Materialize (cost=0.29..8.31 rows=1 width=4) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using useremailprefs_userid_actionnull_groupidnull_unique on useremailprefs useremailprefs_3 (cost=0.29..8.31 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (userid = 943004921)
14. 0.000 0.000 ↓ 0.0

Materialize (cost=4.48..31.45 rows=7 width=12) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useremailprefs useremailprefs_4 (cost=4.48..31.42 rows=7 width=12) (actual rows= loops=)

  • Recheck Cond: (userid = 943004921)
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_useremailprefs_userid (cost=0.00..4.48 rows=7 width=0) (actual rows= loops=)

  • Index Cond: (userid = 943004921)
17. 0.000 0.000 ↓ 0.0

Materialize (cost=4.44..12.30 rows=2 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useremailprefs useremailprefs_5 (cost=4.44..12.29 rows=2 width=8) (actual rows= loops=)

  • Recheck Cond: ((userid = 943004921) AND (action IS NULL))
19. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useremailprefs_userid_action_unique (cost=0.00..4.44 rows=2 width=0) (actual rows= loops=)

  • Index Cond: ((userid = 943004921) AND (action IS NULL))
20. 0.000 0.000 ↓ 0.0

Index Scan using ix_defaultemailprefs_groupid on defaultemailprefs defaultemailprefs_3 (cost=0.42..8.44 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (groupid = invites.ownerid)
21. 0.000 0.000 ↓ 0.0

Index Scan using ix_defaultemailprefs_groupid on defaultemailprefs defaultemailprefs_4 (cost=0.42..8.44 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (groupid = invites.ownerid)
  • Filter: (action IS NULL)