explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IWcF

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

Limit (cost=31,133.95..31,154.20 rows=100 width=3,195) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Unique (cost=31,133.95..33,229.01 rows=10,346 width=3,195) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=31,133.95..31,159.81 rows=10,346 width=3,195) (actual rows= loops=)

  • Sort Key: users.id, users.password, users.last_login, users.is_superuser, users.first_name, users.last_name, users.email, users.phone, users.photo, users.salesforce_data, users.is_staff, users.is_active, users.created, users.updated, users.webhook_id, users.nickname, users.about, users.note, users.bio, users.in_blacklist, users.subscribe, users.birthday, users.country, users.city, users.occupation, (max(rooms_reservations.end_date)), (max((rooms.system_name)::text)), lead_lead.id, lead_lead.created, lead_lead.modified, lead_lead.session_key, lead_lead.web_source, lead_lead.source_id, lead_lead.request_for_package, lead_lead.status, lead_lead.status_changed, lead_lead.status_group, lead_lead.lost_note, lead_lead.from_june_os, lead_lead.first_name, lead_lead.last_name, lead_lead.phone, lead_lead.email, lead_lead.emails_secondary, lead_lead.email_consent, lead_lead.residence_id, lead_lead.price_from, lead_lead.price_to, lead_lead.move_in_from, lead_lead.city_id, lead_lead.move_out, lead_lead.home_type, lead_lead.from_smartform, lead_lead.from_sales_force, lead_lead.from_sign_up, lead_lead.from_social_network_sign_up, lead_lead.salesforce_id, lead_lead.salesforce_status, lead_lead.room_id, lead_lead.created_by_id, lead_lead.updated_by_id, lead_lead.landing_page_url, lead_lead.http_referer, lead_lead.utm_source, lead_lead.utm_medium, lead_lead.utm_campaign, lead_lead.gclid, lead_lead.fbclid, lead_lead.ga, lead_lead.gid, lead_lead.user_id, lead_lead.owner_id, lead_lead.parent_id, lead_lead.note, lead_lead.background_check_report_member1, lead_lead.background_check_report_member2, lead_lead.background_check_report_guarantor1, lead_lead.background_check_report_guarantor2, lead_lead.marketing_inquired_room_id, lead_lead.marketing_facebook_ad_id
4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=15,959.25..16,192.04 rows=10,346 width=3,195) (actual rows= loops=)

  • Group Key: users.id, lead_lead.id
5. 0.000 0.000 ↓ 0.0

Sort (cost=15,959.25..15,985.12 rows=10,346 width=3,184) (actual rows= loops=)

  • Sort Key: users.id, lead_lead.id
6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=996.02..1,087.34 rows=10,346 width=3,184) (actual rows= loops=)

  • Hash Cond: (t15.residence_id = t16.id)
  • Filter: ((upper((users.first_name)::text) ~~ '%A%'::text) OR (upper((users.last_name)::text) ~~ '%A%'::text) OR (upper((users.phone)::text) ~~ '%A%'::text) OR (upper((users.email)::text) ~~ '%A%'::text) OR (upper((users.nickname)::text) ~~ '%A%'::text) OR (upper((t16.title)::text) ~~ '%A%'::text) OR (upper((t16.system_name)::text) ~~ '%A%'::text) OR (upper((t15.system_name)::text) ~~ '%A%'::text) OR (upper((t15.title)::text) ~~ '%A%'::text) OR (upper((t17.email)::text) ~~ '%A%'::text) OR (upper((lead_lead.email)::text) ~~ '%A%'::text) OR (upper((lead_lead.emails_secondary)::text) ~~ '%A%'::text))
7. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=902.52..962.72 rows=10,346 width=3,260) (actual rows= loops=)

  • Merge Cond: (users.id = t17.history_relation_id)
8. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=894.06..919.83 rows=10,346 width=3,228) (actual rows= loops=)

  • Merge Cond: (users.id = lead_lead.user_id)
  • Filter: (((upper((users.first_name)::text) ~~ '%A%'::text) OR (upper((users.last_name)::text) ~~ '%A%'::text) OR (upper((users.phone)::text) ~~ '%A%'::text) OR (upper((users.email)::text) ~~ '%A%'::text) OR (upper((users.nickname)::text) ~~ '%A%'::text) OR (upper((residences.title)::text) ~~ '%A%'::text) OR (upper((residences.system_name)::text) ~~ '%A%'::text) OR (upper((t6.system_name)::text) ~~ '%A%'::text) OR (upper((t6.title)::text) ~~ '%A%'::text) OR (upper((users_historicaluser.email)::text) ~~ '%A%'::text) OR (upper((lead_lead.email)::text) ~~ '%A%'::text) OR (upper((lead_lead.emails_secondary)::text) ~~ '%A%'::text)) AND ((upper((users.first_name)::text) ~~ '%A%'::text) OR (upper((users.last_name)::text) ~~ '%A%'::text) OR (upper((users.phone)::text) ~~ '%A%'::text) OR (upper((users.email)::text) ~~ '%A%'::text) OR (upper((users.nickname)::text) ~~ '%A%'::text) OR (upper((t12.title)::text) ~~ '%A%'::text) OR (upper((t12.system_name)::text) ~~ '%A%'::text) OR (upper((t11.system_name)::text) ~~ '%A%'::text) OR (upper((t11.title)::text) ~~ '%A%'::text) OR (upper((t13.email)::text) ~~ '%A%'::text) OR (upper((lead_lead.email)::text) ~~ '%A%'::text) OR (upper((lead_lead.emails_secondary)::text) ~~ '%A%'::text)))
9. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=893.77..898.39 rows=776 width=3,160) (actual rows= loops=)

  • Merge Cond: (users.id = t13.history_relation_id)
10. 0.000 0.000 ↓ 0.0

Sort (cost=885.31..887.25 rows=776 width=3,128) (actual rows= loops=)

  • Sort Key: users.id
11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=814.85..848.06 rows=776 width=3,128) (actual rows= loops=)

  • Hash Cond: (t14.room_id = t15.id)
12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=737.11..768.27 rows=776 width=3,088) (actual rows= loops=)

  • Hash Cond: (t11.residence_id = t12.id)
13. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=643.61..672.69 rows=776 width=3,057) (actual rows= loops=)

  • Hash Cond: (t10.user_id = users.id)
14. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=77.74..98.55 rows=776 width=48) (actual rows= loops=)

  • Hash Cond: (t10.room_id = t11.id)
15. 0.000 0.000 ↓ 0.0

Seq Scan on rooms_reservations t10 (cost=0.00..18.76 rows=776 width=8) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=69.55..69.55 rows=655 width=48) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on rooms t11 (cost=0.00..69.55 rows=655 width=48) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=556.18..556.18 rows=776 width=3,013) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=529.15..556.18 rows=776 width=3,013) (actual rows= loops=)

  • Hash Cond: (t14.user_id = users.id)
20. 0.000 0.000 ↓ 0.0

Seq Scan on rooms_reservations t14 (cost=0.00..18.76 rows=776 width=8) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=519.45..519.45 rows=776 width=3,009) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=482.90..519.45 rows=776 width=3,009) (actual rows= loops=)

  • Hash Cond: (users.id = users_historicaluser.history_relation_id)
23. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=475.50..508.71 rows=776 width=2,977) (actual rows= loops=)

  • Hash Cond: (t6.residence_id = residences.id)
24. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=382.00..413.13 rows=776 width=2,946) (actual rows= loops=)

  • Hash Cond: (t5.room_id = t6.id)
25. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=304.27..333.34 rows=776 width=2,906) (actual rows= loops=)

  • Hash Cond: (rooms_reservations.room_id = rooms.id)
26. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=226.53..253.56 rows=776 width=2,889) (actual rows= loops=)

  • Hash Cond: (t5.user_id = users.id)
27. 0.000 0.000 ↓ 0.0

Seq Scan on rooms_reservations t5 (cost=0.00..18.76 rows=776 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash (cost=216.83..216.83 rows=776 width=2,885) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=189.80..216.83 rows=776 width=2,885) (actual rows= loops=)

  • Hash Cond: (rooms_reservations.user_id = users.id)
30. 0.000 0.000 ↓ 0.0

Seq Scan on rooms_reservations (cost=0.00..18.76 rows=776 width=12) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Hash (cost=180.10..180.10 rows=776 width=2,877) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Hash Join (cost=159.29..180.10 rows=776 width=2,877) (actual rows= loops=)

  • Hash Cond: (t4.user_id = users.id)
33. 0.000 0.000 ↓ 0.0

Seq Scan on rooms_reservations t4 (cost=0.00..18.76 rows=776 width=4) (actual rows= loops=)

  • Filter: (id IS NOT NULL)
34. 0.000 0.000 ↓ 0.0

Hash (cost=145.24..145.24 rows=1,124 width=2,877) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Seq Scan on users (cost=0.00..145.24 rows=1,124 width=2,877) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Hash (cost=69.55..69.55 rows=655 width=25) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Seq Scan on rooms (cost=0.00..69.55 rows=655 width=25) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Hash (cost=69.55..69.55 rows=655 width=48) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Seq Scan on rooms t6 (cost=0.00..69.55 rows=655 width=48) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash (cost=91.00..91.00 rows=200 width=39) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Seq Scan on residences (cost=0.00..91.00 rows=200 width=39) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Hash (cost=6.62..6.62 rows=62 width=36) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Seq Scan on users_historicaluser (cost=0.00..6.62 rows=62 width=36) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Hash (cost=91.00..91.00 rows=200 width=39) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Seq Scan on residences t12 (cost=0.00..91.00 rows=200 width=39) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash (cost=69.55..69.55 rows=655 width=48) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Seq Scan on rooms t15 (cost=0.00..69.55 rows=655 width=48) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Sort (cost=8.47..8.62 rows=62 width=36) (actual rows= loops=)

  • Sort Key: t13.history_relation_id
49. 0.000 0.000 ↓ 0.0

Seq Scan on users_historicaluser t13 (cost=0.00..6.62 rows=62 width=36) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Index Scan using lead_lead_user_id_91223f04_uniq on lead_lead (cost=0.29..1,941.00 rows=14,985 width=282) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Sort (cost=8.47..8.62 rows=62 width=36) (actual rows= loops=)

  • Sort Key: t17.history_relation_id
52. 0.000 0.000 ↓ 0.0

Seq Scan on users_historicaluser t17 (cost=0.00..6.62 rows=62 width=36) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Hash (cost=91.00..91.00 rows=200 width=39) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on residences t16 (cost=0.00..91.00 rows=200 width=39) (actual rows= loops=)