explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CrX5

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 19,131.337 ↓ 10.0 10 1

Limit (cost=3,673.40..3,673.96 rows=1 width=1,675) (actual time=19,131.264..19,131.337 rows=10 loops=1)

2. 0.053 19,131.317 ↓ 10.0 10 1

Unique (cost=3,673.40..3,673.96 rows=1 width=1,675) (actual time=19,131.263..19,131.317 rows=10 loops=1)

3. 2.768 19,131.264 ↓ 10.0 10 1

Sort (cost=3,673.40..3,673.41 rows=1 width=1,675) (actual time=19,131.262..19,131.264 rows=10 loops=1)

  • Sort Key: (('7917.511728464'::double precision * asin(sqrt((power(sin((((('50.8495891'::double precision - linguists.latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.631358356945763'::double precision * cos(((linguists.latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('-1.0713238'::double precision - linguists.longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision))))))), linguists.id, linguists.title, linguists.first_name, linguists.middle_name, linguists.last_name, linguists.company_name, linguists.mobile_number, linguists.home_number, linguists.fax_number, linguists.email, linguists.secondary_email, linguists.created_at, linguists.updated_at, linguists.latitude, linguists.longitude, linguists.skype, linguists.website_url, linguists.gender, linguists.date_of_birth, linguists.address_line_1, linguists.address_line_2, linguists.address_line_3, linguists.address_postal_code, linguists.address_country, linguists.contact_details_comments, linguists.national_insurance_number, linguists.country_of_birth, linguists.religion, linguists.residency_start_date, linguists.mode_of_transport, linguists.personal_details_comments, linguists.languages_comments, linguists.services_comments, linguists.rates_comments, linguists.registration_comments, linguists.bank_account_number, linguists.bank_account_sort_code, linguists.bank_name, linguists.bank_address_line_1, linguists.bank_address_line_2, linguists.bank_address_line_3, linguists.bank_address_postal_code, linguists.bank_address_country, linguists.other_account_type, linguists.other_account_number, linguists.swift_number, linguists.iban_number, linguists.paypal, linguists.moneybookers, linguists.preferred_method_string, linguists.payment_details_comments, linguists.legacy_linguist_id, linguists.imported_time, linguists.work_number, linguists.trained_by_da, linguists.bank_account_name, linguists.import_comments, linguists.import_approved, linguists.encrypted_password, linguists.reset_password_token, linguists.reset_password_sent_at, linguists.remember_created_at, linguists.sign_in_count, linguists.current_sign_in_at, linguists.last_sign_in_at, linguists.current_sign_in_ip, linguists.last_sign_in_ip, linguists.confirmation_token, linguists.confirmed_at, linguists.confirmation_sent_at, linguists.unconfirmed_email, linguists.invitation_token, linguists.invitation_created_at, linguists.invitation_sent_at, linguists.invitation_accepted_at, linguists.invitation_limit, linguists.invited_by_id, linguists.invited_by_type, linguists.photo_file_name, linguists.photo_content_type, linguists.photo_file_size, linguists.photo_updated_at, linguists.mobile_verification_code, linguists.linguist_account_closure_reasons_by_linguist, linguists.linguist_account_closure_reasons_by_account, linguists.deregisterer_id, linguists.creator_id, linguists.address_city_id, linguists.bank_address_city_id, linguists.account_declined_reasons, linguists.training_confirmation_requestor_id, linguists.training_confirmed_at, linguists.vat_number, linguists.english_language_qualifications, linguists.general_feedback, linguists.remittance_currency, linguists.legacy_approved, linguists.id_issued, linguists.legacy_contract, linguists.legacy_photo, linguists.legacy_supporting_docs, linguists.legacy_post, linguists.legacy_reg_received, linguists.legacy_id, linguists.da_rates_agreed, linguists.mobile_verified, linguists.state_updated_at, linguists.previous_state, linguists.id_string, linguists.state_updated_by_id, linguists.state_updated_by_type, linguists.vat_registered, linguists.skrill, linguists.address_other_city, linguists.language_software, linguists.convictions, linguists.convictions_description, linguists.disability, linguists.role_needs, linguists.service_needs, linguists.current_issues, linguists.past_issues, linguists.impairments, linguists.vaccination_rubella, linguists.vaccination_varicella, linguists.vaccination_tuberculosis, linguists.vaccination_hepatitis_a, linguists.vaccination_hepatitis_b, linguists.general_agreement, linguists.asylum, linguists.tax_liability, linguists.non_compete, linguists.utility_bill_file_name, linguists.utility_bill_content_type, linguists.utility_bill_file_size, linguists.utility_bill_updated_at, linguists.residence_permit_file_name, linguists.residence_permit_content_type, linguists.residence_permit_file_size, linguists.residence_permit_updated_at, linguists.national_insurance_number_proof_file_name, linguists.national_insurance_number_proof_content_type, linguists.national_insurance_number_proof_file_size, linguists.national_insurance_number_proof_updated_at, linguists.ignore_email_validation, linguists.qualifications_comments_for_admin, linguists.qualifications_comments_for_linguist, linguists.utility_bill_2_file_name, linguists.utility_bill_2_content_type, linguists.utility_bill_2_file_size, linguists.utility_bill_2_updated_at, linguists.passport_file_name, linguists.passport_content_type, linguists.passport_file_size, linguists.passport_updated_at, linguists.medical_comments, linguists.references_comments, linguists.eu_passport, linguists.name_string, linguists.mobile_country_code, linguists.full_mobile_number, linguists.uk_resident, linguists.ref_string, linguists.subcontractor, linguists.bookings_count, linguists.translations_count, linguists.interpretings_count, linguists.telephone_interpretings_count, linguists.unavailabilities_count, linguists.immigration_permission, linguists.ignore_reference_validation, linguists.immigration_permission_agreed_date, linguists.asylum_agreed_date, linguists.tax_liability_agreed_date, linguists.non_compete_agreed_date, linguists.general_agreement_agreed_date, linguists.vaccination_rubella_agreed_date, linguists.vaccination_varicella_agreed_date, linguists.vaccination_tuberculosis_agreed_date, linguists.vaccination_hepatitis_a_agreed_date, linguists.vaccination_hepatitis_b_agreed_date, linguists.training_confirmation_reminders_issued, linguists.dbs_reminders_issued, linguists.any_interpretings_count, linguists.last_dbs_reminder_sent_at, linguists.last_training_confirmation_reminder_sent_at, linguists.crb_in_progress, linguists.web_interpretings_count, linguists.use_translation_remittance_matrix, linguists.suspensions, linguists.suspensions_description, linguists.offers_ooh, linguists.notify_of_resources, linguists.tax_reference, linguists.tax_reference_entered, linguists.archived, linguists.last_booked_on, linguists.last_booked_or_created_on, linguists.deleted, linguists.archivable, linguists.completed_interpretings_count, linguists.unsatisfied_interpretings_count, linguists.interpreter_dna_interpretings_count, linguists.completed_translations_count, linguists.unsatisfied_translations_count, linguists.interpreter_dna_translations_count, linguists.completed_telephone_interpretings_count, linguists.unsatisfied_telephone_interpretings_count, linguists.interpreter_dna_telephone_interpretings_count, linguists.completed_web_interpretings_count, linguists.unsatisfied_web_interpretings_count, linguists.interpreter_dna_web_interpretings_count, linguists.agreed_gdpr_flag, linguists.update_service_agreed, linguists.pending_approval_reason, linguists.pending_approval_reason_other, linguists.last_work_permit_reminder_sent_at, linguists.is_notify_me_enabled, linguists.notify_me_disabled_at, (mod((((atan2(((linguists.longitude - '-1.0713238'::double precision) / '57.2957795'::double precision), ((linguists.latitude - '50.8495891'::double precision) / '57.2957795'::double precision)) * '57.2957795'::double precision) + '360'::double precision))::numeric, '360'::numeric))
  • Sort Method: quicksort Memory: 716kB
4. 829.835 19,128.496 ↓ 343.0 343 1

GroupAggregate (cost=3,672.85..3,673.39 rows=1 width=1,675) (actual time=18,011.959..19,128.496 rows=343 loops=1)

  • Group Key: linguists.id
  • Filter: ((count(DISTINCT bookings.id) = linguists.any_interpretings_count) AND (count(DISTINCT linguist_unavailabilities.id) = linguists.unavailabilities_count) AND ((array_position(array_agg(linguist_qualifications.date), NULL::date) IS NOT NULL) OR (min(linguist_qualifications.date) < '2020-10-13'::date)) AND ((array_position(array_agg(linguist_qualifications.date), NULL::date) IS NOT NULL) OR (min(linguist_qualifications.date) < '2020-10-13'::date)))
  • Rows Removed by Filter: 16
5. 12,125.591 18,298.661 ↓ 59,189.6 591,896 1

Sort (cost=3,672.85..3,672.87 rows=10 width=1,647) (actual time=18,007.358..18,298.661 rows=591,896 loops=1)

  • Sort Key: linguists.id
  • Sort Method: external merge Disk: 1,000,776kB
6. 522.468 6,173.070 ↓ 59,189.6 591,896 1

Nested Loop Left Join (cost=3,098.82..3,672.68 rows=10 width=1,647) (actual time=3,277.903..6,173.070 rows=591,896 loops=1)

  • Filter: ((NOT "overlaps"('2020-10-13 12:00:00'::timestamp without time zone, '2020-10-13 15:00:00'::timestamp without time zone, bookings.session_time, (bookings.session_time + (bookings.estimated_duration)::interval))) OR ((bookings.state)::text = ANY ('{client_early_cancel,client_late_cancel,account_admin_cancel,account_sourcing_cancel,client_admin_error_cancel,client_double_booked_cancel,client_end_user_cancel,client_staff_cancel,account_no_telint_cancel,interpreter_enroute_cancel,client_end_user_dna,client_staff_dna,interpreter_dna,client_wrong_language_dna}'::text[])) OR (linguists.any_interpretings_count = 0) OR (linguist_bookings.booking_id = 850,536))
  • Rows Removed by Filter: 110
7. 380.470 4,466.590 ↓ 53,818.7 592,006 1

Nested Loop Left Join (cost=3,098.39..3,656.01 rows=11 width=1,647) (actual time=3,277.885..4,466.590 rows=592,006 loops=1)

8. 2.989 3,705.474 ↓ 2,226.0 2,226 1

Nested Loop Left Join (cost=3,097.97..3,218.92 rows=1 width=1,643) (actual time=3,277.871..3,705.474 rows=2,226 loops=1)

  • Filter: (((((linguist_other_documents.expiry_date >= '2020-10-13'::date) OR (linguist_other_documents.expiry_date IS NULL)) AND linguist_other_documents.approved) OR linguists.eu_passport) AND ((((linguist_other_documents.expiry_date >= '2020-10-13'::date) OR (linguist_other_documents.expiry_date IS NULL)) AND linguist_other_documents.approved) OR linguists.eu_passport))
9. 1.227 3,698.033 ↓ 2,226.0 2,226 1

Nested Loop (cost=3,097.69..3,211.04 rows=1 width=1,643) (actual time=3,277.858..3,698.033 rows=2,226 loops=1)

  • Join Filter: (linguist_qualifications.linguist_id = interpreter_language_pairs.linguist_id)
10. 382.896 3,661.194 ↓ 17,806.0 17,806 1

Hash Right Join (cost=3,097.39..3,210.63 rows=1 width=1,655) (actual time=3,277.841..3,661.194 rows=17,806 loops=1)

  • Hash Cond: (linguist_unavailabilities.linguist_id = linguists.id)
  • Filter: ((NOT "overlaps"('2020-10-13 12:00:00'::timestamp without time zone, '2020-10-13 15:00:00'::timestamp without time zone, linguist_unavailabilities.departure_time, linguist_unavailabilities.return_time)) OR (linguists.unavailabilities_count = 0))
  • Rows Removed by Filter: 88
11. 0.550 0.550 ↑ 1.0 4,364 1

Seq Scan on linguist_unavailabilities (cost=0.00..96.80 rows=4,380 width=24) (actual time=0.004..0.550 rows=4,364 loops=1)

12. 68.671 3,277.748 ↓ 14,408.0 14,408 1

Hash (cost=3,097.38..3,097.38 rows=1 width=1,651) (actual time=3,277.748..3,277.748 rows=14,408 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 8 (originally 1) Memory Usage: 4,066kB
13. 410.840 3,209.077 ↓ 14,408.0 14,408 1

Nested Loop Left Join (cost=606.80..3,097.38 rows=1 width=1,651) (actual time=112.324..3,209.077 rows=14,408 loops=1)

  • Join Filter: ((linguists_with_active_sc.active IS NOT TRUE) AND (linguists_2.id = linguists.id))
  • Rows Removed by Join Filter: 6,883,671
  • Filter: ((((linguists_with_active_sc.max_active_sc_level >= 3) AND linguists_with_active_sc.active) OR (security_clearance_levels_1.level >= 3)) AND (linguists_with_active_sc.active OR (('2020-10-13'::date >= linguist_security_clearances_1.end_date) AND ('2020-10-13'::date <= ((linguist_security_clearances_1.end_date + '1 mon'::interval))::date))) AND (linguists_with_active_sc.active OR (('2020-10-13'::date >= linguist_security_clearances_1.end_date) AND ('2020-10-13'::date <= ((linguist_security_clearances_1.end_date + '1 mon'::interval))::date))))
  • Rows Removed by Filter: 558
14. 13.436 493.473 ↓ 14,966.0 14,966 1

Nested Loop (cost=304.23..2,794.75 rows=1 width=1,656) (actual time=53.020..493.473 rows=14,966 loops=1)

15. 42.849 465.071 ↓ 14,966.0 14,966 1

Nested Loop (cost=304.08..2,793.56 rows=1 width=1,660) (actual time=53.008..465.071 rows=14,966 loops=1)

  • Join Filter: (linguist_qualifications.qualification_id = qualifications.id)
  • Rows Removed by Join Filter: 519,593
16. 9.741 197.732 ↓ 14,966.0 14,966 1

Nested Loop (cost=304.08..2,785.50 rows=1 width=1,660) (actual time=52.991..197.732 rows=14,966 loops=1)

  • Join Filter: (linguist_qualifications.linguist_id = linguists.id)
17. 5.055 112.726 ↓ 15,053.0 15,053 1

Nested Loop (cost=303.79..2,784.54 rows=1 width=25) (actual time=52.958..112.726 rows=15,053 loops=1)

18. 1.245 81.121 ↓ 885.0 4,425 1

Nested Loop (cost=303.37..2,781.33 rows=5 width=13) (actual time=52.925..81.121 rows=4,425 loops=1)

  • Join Filter: (available_services.service_id = services.id)
  • Rows Removed by Join Filter: 6,823
19. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on services (cost=0.00..1.05 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=1)

  • Filter: ((name)::text = 'Interpreting'::text)
  • Rows Removed by Filter: 3
20. 14.039 79.868 ↓ 562.4 11,248 1

Hash Join (cost=303.37..2,780.03 rows=20 width=17) (actual time=52.916..79.868 rows=11,248 loops=1)

  • Hash Cond: (available_services.servable_id = linguists_with_active_sc.active_linguist_id)
21. 12.936 12.936 ↓ 1.0 91,761 1

Seq Scan on available_services (cost=0.00..2,241.75 rows=89,478 width=8) (actual time=0.004..12.936 rows=91,761 loops=1)

  • Filter: ((servable_type)::text = 'Linguist'::text)
  • Rows Removed by Filter: 4,539
22. 0.646 52.893 ↓ 585.5 4,684 1

Hash (cost=303.27..303.27 rows=8 width=9) (actual time=52.893..52.893 rows=4,684 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 266kB
23. 0.414 52.247 ↓ 585.5 4,684 1

Subquery Scan on linguists_with_active_sc (cost=302.85..303.27 rows=8 width=9) (actual time=48.177..52.247 rows=4,684 loops=1)

24. 3.317 51.833 ↓ 585.5 4,684 1

GroupAggregate (cost=302.85..303.19 rows=8 width=9) (actual time=48.176..51.833 rows=4,684 loops=1)

  • Group Key: linguists_1.id
  • Filter: ((min(linguist_security_clearances.start_date) < '2020-10-13'::date) OR (array_position(array_agg(linguist_security_clearances.start_date), NULL::date) IS NOT NULL))
  • Rows Removed by Filter: 90
25. 2.121 48.516 ↓ 889.2 7,114 1

Sort (cost=302.85..302.87 rows=8 width=16) (actual time=48.162..48.516 rows=7,114 loops=1)

  • Sort Key: linguists_1.id
  • Sort Method: quicksort Memory: 526kB
26. 3.945 46.395 ↓ 889.2 7,114 1

Nested Loop (cost=34.61..302.73 rows=8 width=16) (actual time=0.210..46.395 rows=7,114 loops=1)

27. 1.638 8.492 ↓ 239.1 16,979 1

Nested Loop (cost=34.32..115.55 rows=71 width=20) (actual time=0.151..8.492 rows=16,979 loops=1)

28. 0.021 0.050 ↓ 27.0 27 1

Hash Join (cost=18.55..20.88 rows=1 width=12) (actual time=0.023..0.050 rows=27 loops=1)

  • Hash Cond: (security_clearances.security_clearance_level_id = security_clearance_levels.id)
29. 0.019 0.019 ↓ 1.0 27 1

Seq Scan on security_clearances (cost=0.00..2.26 rows=26 width=12) (actual time=0.004..0.019 rows=27 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 6
30. 0.006 0.010 ↓ 1.2 5 1

Hash (cost=18.50..18.50 rows=4 width=12) (actual time=0.010..0.010 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
31. 0.004 0.004 ↓ 1.2 5 1

Seq Scan on security_clearance_levels (cost=0.00..18.50 rows=4 width=12) (actual time=0.003..0.004 rows=5 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 5
32. 5.940 6.804 ↓ 1.1 629 27

Bitmap Heap Scan on linguist_security_clearances (cost=15.77..88.86 rows=582 width=24) (actual time=0.042..0.252 rows=629 loops=27)

  • Recheck Cond: (security_clearance_id = security_clearances.id)
  • Filter: ((deleted_at IS NULL) AND approved)
  • Rows Removed by Filter: 90
  • Heap Blocks: exact=2,391
33. 0.864 0.864 ↓ 1.1 744 27

Bitmap Index Scan on index_linguist_security_clearances_on_security_clearance_id (cost=0.00..15.63 rows=671 width=0) (actual time=0.032..0.032 rows=744 loops=27)

  • Index Cond: (security_clearance_id = security_clearances.id)
34. 33.958 33.958 ↓ 0.0 0 16,979

Index Scan using linguists_pkey on linguists linguists_1 (cost=0.29..2.64 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=16,979)

  • Index Cond: (id = linguist_security_clearances.linguist_id)
  • Filter: ((state)::text = 'approved'::text)
  • Rows Removed by Filter: 1
35. 26.550 26.550 ↓ 3.0 3 4,425

Index Scan using index_linguist_qualifications_on_linguist_id on linguist_qualifications (cost=0.42..0.63 rows=1 width=12) (actual time=0.003..0.006 rows=3 loops=4,425)

  • Index Cond: (linguist_id = available_services.servable_id)
  • Filter: ((deleted_at IS NULL) AND approved AND approved AND ((end_date IS NULL) OR (end_date >= '2020-10-13'::date)) AND ((end_date IS NULL) OR (end_date >= '2020-10-13'::date)))
  • Rows Removed by Filter: 2
36. 75.265 75.265 ↑ 1.0 1 15,053

Index Scan using linguists_pkey on linguists (cost=0.29..0.95 rows=1 width=1,635) (actual time=0.005..0.005 rows=1 loops=15,053)

  • Index Cond: (id = available_services.servable_id)
  • Filter: ((NOT archived) AND is_notify_me_enabled AND ((state)::text <> ALL ('{declined,deregistered}'::text[])) AND (latitude >= '36.3764107889152'::double precision) AND (latitude <= '65.3227674110848'::double precision) AND (longitude >= '-23.9951960381054'::double precision) AND (longitude <= '21.8525484381054'::double precision) AND ((state)::text = 'approved'::text) AND (id <> ALL ('{25584,35488,24114,13050,42774,41539,43831,6444,40015,32722,33785,18713,37969,32538}'::integer[])) AND (('7917.511728464'::double precision * asin(sqrt((power(sin((((('50.8495891'::double precision - latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.631358356945763'::double precision * cos(((latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('-1.0713238'::double precision - longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision)))))) >= '0'::double precision) AND (('7917.511728464'::double precision * asin(sqrt((power(sin((((('50.8495891'::double precision - latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.631358356945763'::double precision * cos(((latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('-1.0713238'::double precision - longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision)))))) <= '1000'::double precision))
  • Rows Removed by Filter: 0
37. 224.490 224.490 ↑ 2.7 36 14,966

Seq Scan on qualifications (cost=0.00..6.86 rows=96 width=8) (actual time=0.002..0.015 rows=36 loops=14,966)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 35
38. 14.966 14.966 ↑ 1.0 1 14,966

Index Scan using qualification_levels_pkey on qualification_levels (cost=0.15..0.67 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=14,966)

  • Index Cond: (id = qualifications.qualification_level_id)
  • Filter: ((deleted_at IS NULL) AND (level >= 1))
39. 1,466.668 2,304.764 ↓ 460.0 460 14,966

Unique (cost=302.57..302.58 rows=1 width=12) (actual time=0.004..0.154 rows=460 loops=14,966)

40. 779.310 838.096 ↓ 1,123.0 1,123 14,966

Sort (cost=302.57..302.58 rows=1 width=12) (actual time=0.004..0.056 rows=1,123 loops=14,966)

  • Sort Key: linguists_2.id, linguist_security_clearances_1.end_date DESC
  • Sort Method: quicksort Memory: 101kB
41. 0.000 58.786 ↓ 1,123.0 1,123 1

Nested Loop (cost=34.61..302.56 rows=1 width=12) (actual time=0.413..58.786 rows=1,123 loops=1)

42. 1.814 8.586 ↓ 239.1 16,979 1

Nested Loop (cost=34.32..115.55 rows=71 width=16) (actual time=0.138..8.586 rows=16,979 loops=1)

43. 0.020 0.049 ↓ 27.0 27 1

Hash Join (cost=18.55..20.88 rows=1 width=12) (actual time=0.021..0.049 rows=27 loops=1)

  • Hash Cond: (security_clearances_1.security_clearance_level_id = security_clearance_levels_1.id)
44. 0.021 0.021 ↓ 1.0 27 1

Seq Scan on security_clearances security_clearances_1 (cost=0.00..2.26 rows=26 width=12) (actual time=0.006..0.021 rows=27 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 6
45. 0.003 0.008 ↓ 1.2 5 1

Hash (cost=18.50..18.50 rows=4 width=12) (actual time=0.008..0.008 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
46. 0.005 0.005 ↓ 1.2 5 1

Seq Scan on security_clearance_levels security_clearance_levels_1 (cost=0.00..18.50 rows=4 width=12) (actual time=0.003..0.005 rows=5 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 5
47. 5.859 6.723 ↓ 1.1 629 27

Bitmap Heap Scan on linguist_security_clearances linguist_security_clearances_1 (cost=15.77..88.86 rows=582 width=20) (actual time=0.041..0.249 rows=629 loops=27)

  • Recheck Cond: (security_clearance_id = security_clearances_1.id)
  • Filter: ((deleted_at IS NULL) AND approved)
  • Rows Removed by Filter: 90
  • Heap Blocks: exact=2,391
48. 0.864 0.864 ↓ 1.1 744 27

Bitmap Index Scan on index_linguist_security_clearances_on_security_clearance_id (cost=0.00..15.63 rows=671 width=0) (actual time=0.032..0.032 rows=744 loops=27)

  • Index Cond: (security_clearance_id = security_clearances_1.id)
49. 50.937 50.937 ↓ 0.0 0 16,979

Index Scan using linguists_pkey on linguists linguists_2 (cost=0.29..2.63 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=16,979)

  • Index Cond: (id = linguist_security_clearances_1.linguist_id)
  • Filter: update_service_agreed
  • Rows Removed by Filter: 1
50. 35.612 35.612 ↓ 0.0 0 17,806

Index Scan using index_interpreter_language_pairs_on_linguist_id on interpreter_language_pairs (cost=0.29..0.40 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=17,806)

  • Index Cond: (linguist_id = available_services.servable_id)
  • Filter: (((language_from_id = 67) AND (language_to_id = 21)) OR ((language_from_id = 21) AND (language_to_id = 67)))
  • Rows Removed by Filter: 2
51. 4.452 4.452 ↓ 0.0 0 2,226

Index Scan using index_linguist_other_documents_on_linguist_id on linguist_other_documents (cost=0.28..7.86 rows=1 width=13) (actual time=0.002..0.002 rows=0 loops=2,226)

  • Index Cond: (linguist_id = linguists.id)
  • Filter: ((deleted_at IS NULL) AND ((document_type)::text = 'work_permit'::text))
52. 380.646 380.646 ↓ 2.3 266 2,226

Index Scan using index_linguist_bookings_on_linguist_id_and_booking_id on linguist_bookings (cost=0.42..435.91 rows=118 width=8) (actual time=0.004..0.171 rows=266 loops=2,226)

  • Index Cond: (linguist_id = linguists.id)
  • Filter: ((cached_booking_type)::text <> 'Translation'::text)
  • Rows Removed by Filter: 22
53. 1,184.012 1,184.012 ↑ 1.0 1 592,006

Index Scan using bookings_pkey on bookings (cost=0.42..1.48 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=592,006)

  • Index Cond: (id = linguist_bookings.booking_id)
Planning time : 9.096 ms
Execution time : 25,078.641 ms