explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qbA

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 17.417 ↓ 0.0 0 1

Unique (cost=155.20..168.00 rows=64 width=3,195) (actual time=17.417..17.417 rows=0 loops=1)

2. 0.310 17.416 ↓ 0.0 0 1

Sort (cost=155.20..155.36 rows=64 width=3,195) (actual time=17.416..17.416 rows=0 loops=1)

  • 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.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
  • Sort Method: quicksort Memory: 25kB
3. 0.002 17.106 ↓ 0.0 0 1

HashAggregate (cost=152.64..153.28 rows=64 width=3,195) (actual time=17.106..17.106 rows=0 loops=1)

  • Group Key: users.id, lead_lead.id
4. 0.001 17.104 ↓ 0.0 0 1

Nested Loop Left Join (cost=58.67..152.00 rows=64 width=3,184) (actual time=17.104..17.104 rows=0 loops=1)

5. 0.000 17.103 ↓ 0.0 0 1

Nested Loop Left Join (cost=58.40..110.19 rows=64 width=3,167) (actual time=17.103..17.103 rows=0 loops=1)

6. 0.001 17.103 ↓ 0.0 0 1

Nested Loop (cost=58.12..87.18 rows=64 width=3,159) (actual time=17.103..17.103 rows=0 loops=1)

7. 0.001 17.102 ↓ 0.0 0 1

Merge Join (cost=57.84..86.17 rows=1 width=286) (actual time=17.102..17.102 rows=0 loops=1)

  • Merge Cond: (lead_lead.user_id = t4.user_id)
8. 17.101 17.101 ↓ 0.0 0 1

Index Scan using lead_lead_user_id_91223f04_uniq on lead_lead (cost=0.29..2,390.55 rows=92 width=282) (actual time=17.101..17.101 rows=0 loops=1)

  • Filter: (((upper((email)::text) ~~ '%RED%'::text) OR (upper((emails_secondary)::text) ~~ '%RED%'::text)) AND ((upper((email)::text) ~~ '%HAT%'::text) OR (upper((emails_secondary)::text) ~~ '%HAT%'::text)))
  • Rows Removed by Filter: 14985
9. 0.000 0.000 ↓ 0.0 0

Sort (cost=56.01..57.95 rows=776 width=4) (never executed)

  • Sort Key: t4.user_id
10. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using users_pkey on users (cost=0.28..1.02 rows=1 width=2,877) (never executed)

  • Index Cond: (id = t4.user_id)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using rooms_reservations_user_id_d5b31217 on rooms_reservations (cost=0.28..0.35 rows=1 width=12) (never executed)

  • Index Cond: (users.id = user_id)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using rooms_pkey on rooms (cost=0.28..0.65 rows=1 width=25) (never executed)

  • Index Cond: (rooms_reservations.room_id = id)