explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R4uh

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

Sort (cost=291,619.94..291,619.98 rows=15 width=620) (actual rows= loops=)

  • Sort Key: ""Extent4"".date DESC, ""Extent4"".organization_id, ""Extent4"".id, ""Extent1"".organization_id, ""Extent1"".id, ""Extent5"".id, ""Extent5"".organization_id, ""Extent6"".organization_id, ""Extent6"".id, ""Extent11"".organization_id, ""Extent14"".user_id, ""Extent15"".user_id, ""Extent11"".id, ""Extent13"".organization_id, ""Extent16"".id, ""Extent17"".id, ""Extent18"".id, ""Extent19"".id, ""Extent13"".id, ""Extent12"".id, (1000), (CASE WHEN (""Extent21"".organization_id IS NULL) THEN NULL::integer ELSE 1 END)
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=290,660.41..291,619.65 rows=15 width=620) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Limit (cost=290,660.12..291,498.66 rows=15 width=605) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Result (cost=290,660.12..291,498.66 rows=15 width=605) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=290,660.12..290,660.16 rows=15 width=592) (actual rows= loops=)

  • Sort Key: "Extent4".date DESC
6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..290,659.83 rows=15 width=592) (actual rows= loops=)

  • Join Filter: ("Extent11".location_id = "Extent19".id)
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..290,501.18 rows=15 width=680) (actual rows= loops=)

  • Join Filter: ("Extent11".interest_id = "Extent18".id)
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..290,218.99 rows=15 width=645) (actual rows= loops=)

  • Join Filter: ("Extent11".education_id = "Extent17".id)
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..289,203.43 rows=15 width=608) (actual rows= loops=)

  • Join Filter: ("Extent12".category_id = "Extent16".id)
10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..289,075.68 rows=15 width=587) (actual rows= loops=)

  • Join Filter: (CASE WHEN (CASE WHEN (false) THEN '0X0X'::text WHEN (false) THEN '0X1X'::text ELSE '0X2X'::text END ~~ '0X2X%'::text) THEN CASE WHEN (false) THEN NULL::uuid WHEN (false) THEN NULL::uuid ELSE "Extent1".user_id END ELSE NULL::uuid END = "Extent15".user_id)
11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..288,829.18 rows=15 width=570) (actual rows= loops=)

  • Join Filter: (CASE WHEN (CASE WHEN (false) THEN '0X0X'::text WHEN (false) THEN '0X1X'::text ELSE '0X2X'::text END ~~ '0X1X%'::text) THEN CASE WHEN (false) THEN NULL::uuid WHEN (false) THEN (NULL::uuid) ELSE NULL::uuid END ELSE NULL::uuid END = "Extent14".user_id)
12. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,163.02..288,582.68 rows=15 width=553) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,162.59..288,530.89 rows=15 width=486) (actual rows= loops=)

  • Join Filter: ("Extent11".channel_id = "Extent12".id)
14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=87,162.59..288,248.84 rows=15 width=457) (actual rows= loops=)

  • Join Filter: ("Extent1".organization_id = "Extent11".organization_id)
15. 0.000 0.000 ↓ 0.0

Hash Join (cost=87,162.16..288,235.81 rows=15 width=401) (actual rows= loops=)

  • Hash Cond: ("Extent1".id = "Extent4".id)
16. 0.000 0.000 ↓ 0.0

Append (cost=5.47..196,237.37 rows=352,116 width=87) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Append (cost=5.47..9,562.58 rows=23,168 width=87) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on forwards "Extent1" (cost=5.47..206.42 rows=153 width=87) (actual rows= loops=)

  • Recheck Cond: (organization_id = 30)
19. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_forward_forwards_organization_id_incoming_message_id (cost=0.00..5.43 rows=153 width=0) (actual rows= loops=)

  • Index Cond: (organization_id = 30)
20. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on incoming_messages "Extent2" (cost=542.79..9,124.48 rows=23,015 width=87) (actual rows= loops=)

  • Recheck Cond: (organization_id = 30)
21. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_incoming_messages_organization_id (cost=0.00..537.04 rows=23,015 width=0) (actual rows= loops=)

  • Index Cond: (organization_id = 30)
22. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=16,297.78..186,443.11 rows=328,948 width=87) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on outgoing_messages "Extent3" (cost=16,297.78..183,153.63 rows=328,948 width=81) (actual rows= loops=)

  • Recheck Cond: (organization_id = 30)
24. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_outgoing_messages_organization_id (cost=0.00..16,215.54 rows=328,948 width=0) (actual rows= loops=)

  • Index Cond: (organization_id = 30)
25. 0.000 0.000 ↓ 0.0

Hash (cost=87,153.44..87,153.44 rows=260 width=314) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=45,989.64..87,153.44 rows=260 width=314) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash Join (cost=45,989.21..78,301.88 rows=1,413 width=24) (actual rows= loops=)

  • Hash Cond: ("Extent5".old_candidate_id = "Extent6".id)
28. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on enquiries "Extent5" (cost=1,485.46..33,597.60 rows=49,706 width=20) (actual rows= loops=)

  • Recheck Cond: (organization_id = 30)
  • Filter: (dropped_id IS NULL)
29. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_enquiries_organization_id (cost=0.00..1,473.03 rows=52,347 width=0) (actual rows= loops=)

  • Index Cond: (organization_id = 30)
30. 0.000 0.000 ↓ 0.0

Hash (cost=44,019.33..44,019.33 rows=38,754 width=12) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on candidates "Extent6" (cost=1,144.58..44,019.33 rows=38,754 width=12) (actual rows= loops=)

  • Recheck Cond: (organization_id = 30)
  • Filter: ((NOT is_hidden) AND (anonymized_date IS NULL))
32. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_candidates_organization_id (cost=0.00..1,134.89 rows=41,046 width=0) (actual rows= loops=)

  • Index Cond: ((organization_id = 30) AND (is_hidden = false))
33. 0.000 0.000 ↓ 0.0

Index Scan using ix_message_messages_organization_id_enquiry_id on messages "Extent4" (cost=0.43..6.25 rows=1 width=290) (actual rows= loops=)

  • Index Cond: ((organization_id = 30) AND (enquiry_id = "Extent5".id))
34. 0.000 0.000 ↓ 0.0

Index Scan using uq_enquiry_enquiries_id on enquiries "Extent11" (cost=0.43..0.86 rows=1 width=64) (actual rows= loops=)

  • Index Cond: ("Extent4".enquiry_id = id)
  • Filter: (organization_id = 30)
35. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..33.74 rows=1,116 width=37) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Seq Scan on channels "Extent12" (cost=0.00..28.16 rows=1,116 width=37) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Index Scan using pk_dbo_candidate on candidates "Extent13" (cost=0.43..3.44 rows=1 width=75) (actual rows= loops=)

  • Index Cond: (("Extent11".organization_id = organization_id) AND (organization_id = 30) AND ("Extent11".old_candidate_id = id))
38. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..74.90 rows=660 width=33) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Seq Scan on institute_users "Extent14" (cost=0.00..71.60 rows=660 width=33) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..74.90 rows=660 width=33) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Seq Scan on institute_users "Extent15" (cost=0.00..71.60 rows=660 width=33) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..69.90 rows=260 width=21) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Seq Scan on categories "Extent16" (cost=0.00..68.60 rows=260 width=21) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..104.43 rows=4,095 width=37) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Seq Scan on educations "Extent17" (cost=0.00..83.95 rows=4,095 width=37) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..31.88 rows=1,125 width=35) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Seq Scan on interests "Extent18" (cost=0.00..26.25 rows=1,125 width=35) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..15.62 rows=641 width=19) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Seq Scan on locations "Extent19" (cost=0.00..12.41 rows=641 width=19) (actual rows= loops=)

50.          

SubPlan (for Result)

51. 0.000 0.000 ↓ 0.0

Aggregate (cost=25.69..25.70 rows=1 width=8) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..25.69 rows=1 width=8) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Index Scan using ix_message_messages_organization_id_parent_id on messages "Extent10" (cost=0.43..8.45 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent1".organization_id) AND ("Extent1".id = parent_id))
54. 0.000 0.000 ↓ 0.0

Append (cost=0.29..17.20 rows=3 width=12) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_forward_forwards_organization_id_id on forwards "Extent7" (cost=0.29..4.30 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent1".organization_id) AND (id = "Extent10".id))
56. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_message_incoming_messages_organization_id_id on incoming_messages "Extent8" (cost=0.43..4.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent1".organization_id) AND (id = "Extent10".id))
57. 0.000 0.000 ↓ 0.0

Index Scan using uq_message_outgoing_messages_id on outgoing_messages "Extent9" (cost=0.43..8.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id = "Extent10".id)
  • Filter: (organization_id = "Extent1".organization_id)
58. 0.000 0.000 ↓ 0.0

Aggregate (cost=25.69..25.70 rows=1 width=8) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..25.69 rows=1 width=8) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Index Scan using ix_message_messages_organization_id_parent_id on messages "Extent10_1" (cost=0.43..8.45 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent1".organization_id) AND ("Extent1".id = parent_id))
61. 0.000 0.000 ↓ 0.0

Append (cost=0.29..17.20 rows=3 width=12) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_forward_forwards_organization_id_id on forwards "Extent7_1" (cost=0.29..4.30 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent1".organization_id) AND (id = "Extent10_1".id))
63. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_message_incoming_messages_organization_id_id on incoming_messages "Extent8_1" (cost=0.43..4.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent1".organization_id) AND (id = "Extent10_1".id))
64. 0.000 0.000 ↓ 0.0

Index Scan using uq_message_outgoing_messages_id on outgoing_messages "Extent9_1" (cost=0.43..8.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id = "Extent10_1".id)
  • Filter: (organization_id = "Extent1".organization_id)
65. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.45..4.46 rows=1 width=4) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_enquiry_enquiries_organization_id_old_candidate_id on enquiries "Extent20" (cost=0.43..4.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((organization_id = "Extent13".organization_id) AND (old_candidate_id = "Extent13".id))
67. 0.000 0.000 ↓ 0.0

Index Scan using ix_forward_receivers_organization_id_forward_message_id on receivers "Extent21" (cost=0.29..8.05 rows=1 width=35) (actual rows= loops=)

  • Index Cond: (((CASE WHEN (CASE WHEN (false) THEN '0X0X'::text WHEN (false) THEN '0X1X'::text ELSE '0X2X'::text END ~~ '0X2X%'::text) THEN "Extent1".organization_id ELSE NULL::integer END) = organization_id) AND ((CASE WHEN (CASE WHEN (false) THEN '0X0X'::text WHEN (false) THEN '0X1X'::text ELSE '0X2X'::text END ~~ '0X2X%'::text) THEN "Extent1".id ELSE NULL::bigint END) = forward_message_id))
  • Filter: ((receiver_type_id = '3'::smallint) OR (receiver_type_id = '2'::smallint) OR (receiver_type_id = '1'::smallint))