PgHero
No long running queries
Connections healthy 61
Vacuuming healthy
No columns near integer overflow
11 invalid constraints
138 duplicate indexes
4 suggested indexes
11 slow queries

Invalid Constraints

These constraints are marked as NOT VALID. You should validate them.

Name
evaluation_contest_criterion_results_either_snapshot_or_qa_eval
ALTER TABLE evaluation_contest_scorecard_criterion_results VALIDATE CONSTRAINT evaluation_contest_criterion_results_either_snapshot_or_qa_eval;
evaluation_contests_either_snapshot_or_qa_eval
ALTER TABLE evaluation_contests VALIDATE CONSTRAINT evaluation_contests_either_snapshot_or_qa_eval;
fk_rails_099993c7f4
ALTER TABLE organization_notification_settings VALIDATE CONSTRAINT fk_rails_099993c7f4;
fk_rails_1e04d494c4
ALTER TABLE jira_issues VALIDATE CONSTRAINT fk_rails_1e04d494c4;
fk_rails_35809d5f28
ALTER TABLE conversations VALIDATE CONSTRAINT fk_rails_35809d5f28;
fk_rails_5886da124d
ALTER TABLE evaluation_contest_criterion_feedbacks VALIDATE CONSTRAINT fk_rails_5886da124d;
fk_rails_d7af39671a
ALTER TABLE conversations VALIDATE CONSTRAINT fk_rails_d7af39671a;
fk_rails_efe8962de0
ALTER TABLE evaluation_assignments VALIDATE CONSTRAINT fk_rails_efe8962de0;
fk_rails_fae0c84991
ALTER TABLE qa_agent_evaluations VALIDATE CONSTRAINT fk_rails_fae0c84991;
fk_rails_96a53e5ab7
ALTER TABLE conversation_part_call_details VALIDATE CONSTRAINT fk_rails_96a53e5ab7;
fk_rails_787c42f1b7
ALTER TABLE conversation_part_call_details VALIDATE CONSTRAINT fk_rails_787c42f1b7;

Duplicate Indexes

These indexes exist, but aren’t needed. Remove them for faster writes.

rails generate migration remove_unneeded_indexes

And paste

remove_index :agent_integration_profiles, name: "idx_on_organization_data_source_id_a0338582a9", column: :organization_data_source_id
remove_index :agent_performance_report_citations, name: "idx_on_agent_performance_report_id_25a67f1748", column: :agent_performance_report_id
remove_index :agent_performance_reports, name: "index_agent_performance_reports_on_employee_id", column: :employee_id
remove_index :agent_performance_reports, name: "index_agent_performance_reports_on_organization_id", column: :organization_id
remove_index :agents, name: "index_agents_on_organization_id", column: :organization_id
remove_index :audit_control_frameworks, name: "index_audit_control_frameworks_on_audit_control_id", column: :audit_control_id
remove_index :audit_control_test_results, name: "index_audit_control_test_results_on_audit_result_id", column: :audit_result_id
remove_index :call_behavioral_risk_indicator_results, name: "index_call_behavioral_risk_indicator_results_on_call_id", column: :call_id
remove_index :calls, name: "index_calls_on_data_source_id", column: :data_source_id
remove_index :companies, name: "index_companies_on_organization_data_source_id", column: :organization_data_source_id
remove_index :company_field_values, name: "index_company_field_values_on_company_id", column: :company_id
remove_index :company_fields, name: "index_company_fields_on_organization_data_source_id", column: :organization_data_source_id
remove_index :complaint_theme_snapshot_complaints, name: "idx_on_complaint_theme_snapshot_id_fc76ec58fb", column: :complaint_theme_snapshot_id
remove_index :conversation_agents, name: "index_conversation_agents_on_conversation_id", column: :conversation_id
remove_index :conversation_agents, name: "index_conversation_agents_on_organization_id", column: :organization_id
remove_index :conversation_assignee_accounts, name: "index_conversation_assignee_accounts_on_conversation_id", column: :conversation_id
remove_index :conversation_assignee_roles, name: "index_conversation_assignee_roles_on_conversation_id", column: :conversation_id
remove_index :conversation_customer_sentiment_summaries, name: "idx_on_organization_id_d48e480ccf", column: :organization_id
remove_index :conversation_customers, name: "index_conversation_customers_on_conversation_id", column: :conversation_id
remove_index :conversation_customers, name: "index_conversation_customers_on_organization_id", column: :organization_id
remove_index :conversation_cx_risk_indicator_results, name: "idx_on_conversation_id_4c22ef40a3", column: :conversation_id
remove_index :conversation_cx_risk_snapshot_assignee_accounts, name: "idx_on_conversation_cx_risk_snapshot_id_9254f05dc4", column: :conversation_cx_risk_snapshot_id
remove_index :conversation_cx_risk_snapshot_assignee_roles, name: "idx_on_conversation_cx_risk_snapshot_id_6fbbdcec7c", column: :conversation_cx_risk_snapshot_id
remove_index :conversation_cx_risk_snapshot_scorecard_criterion_results, name: "idx_on_conversation_cx_risk_snapshot_scorecard_resu_a09a2aca21", column: :conversation_cx_risk_snapshot_scorecard_result_id
remove_index :conversation_cx_risk_snapshots, name: "index_conversation_cx_risk_snapshots_on_organization_id", column: :organization_id
remove_index :conversation_field_values, name: "index_conversation_field_values_on_conversation_id", column: :conversation_id
remove_index :conversation_fields, name: "index_conversation_fields_on_organization_data_source_id", column: :organization_data_source_id
remove_index :conversation_filter_results, name: "index_conversation_filter_results_on_organization_id", column: :organization_id
remove_index :conversation_groups, name: "index_conversation_groups_on_organization_id", column: :organization_id
remove_index :conversation_partners, name: "index_conversation_partners_on_organization_id", column: :organization_id
remove_index :conversation_parts, name: "index_conversation_parts_on_author_employee_id", column: :author_employee_id
remove_index :conversation_parts, name: "index_conversation_parts_on_conversation_id", column: :conversation_id
remove_index :conversation_relationships, name: "index_conversation_relationships_on_conversation_id", column: :conversation_id
remove_index :conversation_resolution_assignment_rule_assignee_accounts, name: "idx_on_conversation_resolution_assignment_rule_id_426032d977", column: :conversation_resolution_assignment_rule_id
remove_index :conversation_resolution_assignment_rule_assignee_roles, name: "idx_on_conversation_resolution_assignment_rule_id_71f70ad8f3", column: :conversation_resolution_assignment_rule_id
remove_index :conversation_sla_applications, name: "index_conversation_sla_applications_on_organization_id", column: :organization_id
remove_index :conversations, name: "index_conversations_on_customer_issue_id", column: :customer_issue_id
remove_index :conversations, name: "index_conversations_on_organization_id", column: :organization_id
remove_index :conversations, name: "idx_on_organization_id_interaction_type_complaint_r_512c2730b7", column: [:organization_id, :interaction_type, :complaint_risk_level]
remove_index :conversations, name: "idx_on_organization_id_interaction_type_compliance__15c7b570ac", column: [:organization_id, :interaction_type, :compliance_risk_level]
remove_index :conversations, name: "idx_on_organization_id_interaction_type_dispute_ris_1c9318ac66", column: [:organization_id, :interaction_type, :dispute_risk_level]
remove_index :conversations, name: "idx_on_organization_id_interaction_type_product_iss_4ffb30086e", column: [:organization_id, :interaction_type, :product_issue_risk_level]
remove_index :conversations, name: "idx_on_organization_id_interaction_type_risk_level_0a0a93fffd", column: [:organization_id, :interaction_type, :risk_level]
remove_index :conversations, name: "idx_on_organization_id_interaction_type_service_iss_06824fffbf", column: [:organization_id, :interaction_type, :service_issue_risk_level]
remove_index :conversations, name: "idx_on_organization_id_interaction_type_started_at_44de9acb05", column: [:organization_id, :interaction_type, :started_at]
remove_index :customer_companies, name: "index_customer_companies_on_client_id", column: :client_id
remove_index :customer_complaint_assignee_accounts, name: "idx_on_customer_complaint_id_064d6f5bf4", column: :customer_complaint_id
remove_index :customer_complaint_assignee_roles, name: "idx_on_customer_complaint_id_d994db35f6", column: :customer_complaint_id
remove_index :customer_complaint_categorizations, name: "idx_on_customer_complaint_id_9e56a42434", column: :customer_complaint_id
remove_index :customer_complaint_category_keywords, name: "idx_on_customer_complaint_category_id_fcaa616bae", column: :customer_complaint_category_id
remove_index :customer_complaint_conversations, name: "idx_on_customer_complaint_id_6ca8c79343", column: :customer_complaint_id
remove_index :customer_complaints, name: "index_customer_complaints_on_organization_id", column: :organization_id
remove_index :customer_field_values, name: "index_customer_field_values_on_client_id", column: :client_id
remove_index :customer_fields, name: "index_customer_fields_on_organization_data_source_id", column: :organization_data_source_id
remove_index :customer_issue_conversation_fields, name: "index_customer_issue_conversation_fields_on_organization_id", column: :organization_id
remove_index :customer_issue_theme_snapshot_conversations, name: "idx_on_customer_issue_theme_snapshot_id_8805247ed5", column: :customer_issue_theme_snapshot_id
remove_index :customer_issues, name: "index_customer_issues_on_organization_id", column: :organization_id
remove_index :dashboard_filter_rules, name: "index_dashboard_filter_rules_on_dashboard_id", column: :dashboard_id
remove_index :dashboard_widget_types, name: "index_dashboard_widget_types_on_dashboard_widget_type_group_id", column: :dashboard_widget_type_group_id
remove_index :dashboard_widgets, name: "index_dashboard_widgets_on_dashboard_id", column: :dashboard_id
remove_index :employee_field_values, name: "index_employee_field_values_on_employee_id", column: :employee_id
remove_index :employee_fields, name: "index_employee_fields_on_organization_data_source_id", column: :organization_data_source_id
remove_index :employees, name: "index_employees_on_organization_id", column: :organization_id
remove_index :evaluation_assignments, name: "index_evaluation_assignments_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_accounts, name: "index_evaluation_batch_accounts_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_assignees, name: "index_evaluation_batch_assignees_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_channels, name: "index_evaluation_batch_channels_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_conversation_check_comments, name: "idx_on_evaluation_batch_conversation_review_id_ac87a427f9", column: :evaluation_batch_conversation_review_id
remove_index :evaluation_batch_conversation_check_result_reactions, name: "idx_on_evaluation_batch_conversation_review_id_401c40c52b", column: :evaluation_batch_conversation_review_id
remove_index :evaluation_batch_conversation_reviews, name: "idx_on_evaluation_batch_conversation_id_c69a29d99a", column: :evaluation_batch_conversation_id
remove_index :evaluation_batch_conversations, name: "index_evaluation_batch_conversations_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_groups, name: "index_evaluation_batch_groups_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_roles, name: "index_evaluation_batch_roles_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_scorecards, name: "index_evaluation_batch_scorecards_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batch_zendesk_brands, name: "index_evaluation_batch_zendesk_brands_on_evaluation_batch_id", column: :evaluation_batch_id
remove_index :evaluation_batches, name: "index_evaluation_batches_on_evaluation_schedule_id", column: :evaluation_schedule_id
remove_index :evaluation_batches, name: "index_evaluation_batches_on_organization_id", column: :organization_id
remove_index :evaluation_checks, name: "index_evaluation_checks_on_conversation_cx_risk_snapshot_id", column: :conversation_cx_risk_snapshot_id
remove_index :evaluation_compliance_criterion_group_results, name: "idx_on_conversation_cx_risk_snapshot_id_7177d5eea0", column: :conversation_cx_risk_snapshot_id
remove_index :evaluation_compliance_criterion_results, name: "idx_on_evaluation_compliance_criterion_group_result_7cc6ff7daa", column: :evaluation_compliance_criterion_group_result_id
remove_index :evaluation_contest_scorecard_criterion_results, name: "idx_on_evaluation_contest_id_ad6d4d521c", column: :evaluation_contest_id
remove_index :evaluation_eligibility_rules, name: "index_evaluation_eligibility_rules_on_organization_id", column: :organization_id
remove_index :evaluation_guiding_question_answers, name: "idx_on_conversation_cx_risk_snapshot_scorecard_crit_73fa1010e0", column: :conversation_cx_risk_snapshot_scorecard_criterion_result_id
remove_index :evaluation_sampling_rule_counters, name: "index_evaluation_sampling_rule_counters_on_organization_id", column: :organization_id
remove_index :evaluation_sampling_rule_targets, name: "idx_on_evaluation_sampling_rule_id_42a24d7591", column: :evaluation_sampling_rule_id
remove_index :evaluation_schedule_accounts, name: "index_evaluation_schedule_accounts_on_evaluation_schedule_id", column: :evaluation_schedule_id
remove_index :evaluation_schedule_channels, name: "index_evaluation_schedule_channels_on_evaluation_schedule_id", column: :evaluation_schedule_id
remove_index :evaluation_schedule_conversations, name: "idx_on_evaluation_schedule_id_2ec5d7dfe3", column: :evaluation_schedule_id
remove_index :evaluation_schedule_groups, name: "index_evaluation_schedule_groups_on_evaluation_schedule_id", column: :evaluation_schedule_id
remove_index :evaluation_schedule_roles, name: "index_evaluation_schedule_roles_on_evaluation_schedule_id", column: :evaluation_schedule_id
remove_index :evaluation_schedule_scorecards, name: "index_evaluation_schedule_scorecards_on_evaluation_schedule_id", column: :evaluation_schedule_id
remove_index :evaluation_schedule_zendesk_brands, name: "idx_on_evaluation_schedule_id_b3cbdbbdc9", column: :evaluation_schedule_id
remove_index :evaluation_schedules, name: "index_evaluation_schedules_on_organization_id", column: :organization_id
remove_index :group_employees, name: "index_group_employees_on_organization_id", column: :organization_id
remove_index :group_memberships, name: "index_group_memberships_on_membership_id", column: :membership_id
remove_index :groups, name: "index_groups_on_organization_id", column: :organization_id
remove_index :invitation_scopes, name: "index_invitation_scopes_on_organization_id", column: :organization_id
remove_index :invitation_scopes, name: "index_invitation_scopes_on_scope_type_and_scope_id", column: [:scope_type, :scope_id]
remove_index :jira_issue_request_field_values, name: "index_jira_issue_request_field_values_on_jira_issue_id", column: :jira_issue_id
remove_index :jira_request_type_fields, name: "index_jira_request_type_fields_on_jira_request_type_id", column: :jira_request_type_id
remove_index :jira_request_types, name: "index_jira_request_types_on_organization_data_source_id", column: :organization_data_source_id
remove_index :jira_service_desks, name: "index_jira_service_desks_on_organization_data_source_id", column: :organization_data_source_id
remove_index :knowledge_base_document_scorecard_criteria, name: "idx_on_knowledge_base_document_id_8ebdbd979f", column: :knowledge_base_document_id
remove_index :manual_evaluation_guiding_question_answers, name: "idx_on_manual_evaluation_scorecard_criterion_result_a8f0949c67", column: :manual_evaluation_scorecard_criterion_result_id
remove_index :manual_evaluation_scorecard_criterion_results, name: "idx_on_manual_evaluation_scorecard_result_id_980b617d3a", column: :manual_evaluation_scorecard_result_id
remove_index :manual_evaluation_scorecard_results, name: "idx_on_manual_evaluation_id_1d6e604059", column: :manual_evaluation_id
remove_index :membership_connection_profiles, name: "index_membership_connection_profiles_on_membership_id", column: :membership_id
remove_index :membership_scopes, name: "index_membership_scopes_on_organization_id", column: :organization_id
remove_index :membership_scopes, name: "index_membership_scopes_on_scope_type_and_scope_id", column: [:scope_type, :scope_id]
remove_index :memberships, name: "index_memberships_on_account_id", column: :account_id
remove_index :phishing_case_email_steps, name: "index_phishing_case_email_steps_on_phishing_case_id", column: :phishing_case_id
remove_index :phishing_case_sms_steps, name: "index_phishing_case_sms_steps_on_phishing_case_id", column: :phishing_case_id
remove_index :phishing_case_training_run_answers, name: "idx_on_phishing_case_training_run_id_b425c7523b", column: :phishing_case_training_run_id
remove_index :phishing_case_training_step_question_content_options, name: "idx_on_phishing_case_training_step_question_content_d4ed3e7b0b", column: :phishing_case_training_step_question_content_id
remove_index :phishing_case_training_steps, name: "index_phishing_case_training_steps_on_phishing_case_id", column: :phishing_case_id
remove_index :pinned_conversations, name: "index_pinned_conversations_on_employee_id", column: :employee_id
remove_index :qa_agent_evaluation_guiding_question_answers, name: "idx_on_qa_agent_evaluation_scorecard_criterion_resu_6b6fb624c8", column: :qa_agent_evaluation_scorecard_criterion_result_id
remove_index :qa_agent_evaluation_scorecard_criterion_check_results, name: "idx_on_qa_agent_evaluation_scorecard_criterion_resu_c66f17ba2b", column: :qa_agent_evaluation_scorecard_criterion_result_id
remove_index :qa_agent_evaluation_scorecard_criterion_results, name: "idx_on_qa_agent_evaluation_scorecard_result_id_89de694f41", column: :qa_agent_evaluation_scorecard_result_id
remove_index :qa_agent_evaluation_scorecard_results, name: "idx_on_qa_agent_evaluation_id_8dbc670dd0", column: :qa_agent_evaluation_id
remove_index :qa_agent_evaluations, name: "index_qa_agent_evaluations_on_conversation_id", column: :conversation_id
remove_index :qa_agent_evaluations, name: "index_qa_agent_evaluations_on_organization_id", column: :organization_id
remove_index :qa_evaluations, name: "index_qa_evaluations_on_organization_id", column: :organization_id
remove_index :risk_frameworks, name: "index_risk_frameworks_on_organization_id", column: :organization_id
remove_index :risk_indicator_groups, name: "index_risk_indicator_groups_on_risk_framework_id", column: :risk_framework_id
remove_index :role_permissions, name: "index_role_permissions_on_role_id", column: :role_id
remove_index :scorecard_conditions, name: "index_scorecard_conditions_on_scorecard_id", column: :scorecard_id
remove_index :scorecard_criteria, name: "index_scorecard_criteria_on_scorecard_id", column: :scorecard_id
remove_index :scorecard_criterion_check_conditions, name: "idx_on_scorecard_criterion_check_id_2ea52186aa", column: :scorecard_criterion_check_id
remove_index :scorecard_criterion_checks, name: "index_scorecard_criterion_checks_on_scorecard_criterion_id", column: :scorecard_criterion_id
remove_index :scorecard_groups, name: "index_scorecard_groups_on_scorecard_id", column: :scorecard_id
remove_index :scoring_guides, name: "index_scoring_guides_on_organization_id", column: :organization_id
remove_index :sla_breaches, name: "index_sla_breaches_on_conversation_id", column: :conversation_id
remove_index :slack_channels, name: "index_slack_channels_on_organization_id", column: :organization_id
remove_index :slack_messages, name: "index_slack_messages_on_organization_id", column: :organization_id
remove_index :social_media_risk_event_posts, name: "idx_on_social_media_risk_event_id_baee004268", column: :social_media_risk_event_id
remove_index :view_columns, name: "index_view_columns_on_view_id", column: :view_id
remove_index :zendesk_brands, name: "index_zendesk_brands_on_organization_data_source_id", column: :organization_data_source_id
Details
On agent_integration_profiles
idx_on_organization_data_source_id_a0338582a9 (organization_data_source_id)
is covered by
idx_on_organization_data_source_id_external_id_09599c1bd3 (organization_data_source_id, external_id)
On agent_performance_report_citations
idx_on_agent_performance_report_id_25a67f1748 (agent_performance_report_id)
is covered by
idx_on_agent_performance_report_id_citation_index_2860fce464 (agent_performance_report_id, citation_index)
On agent_performance_reports
index_agent_performance_reports_on_employee_id (employee_id)
is covered by
idx_on_employee_id_report_type_start_date_78183106d6 (employee_id, report_type, start_date)
On agent_performance_reports
index_agent_performance_reports_on_organization_id (organization_id)
is covered by
idx_on_organization_id_report_type_start_date_78880a00ec (organization_id, report_type, start_date)
On agents
index_agents_on_organization_id (organization_id)
is covered by
idx_on_organization_id_data_source_id_data_source_u_aa14b00f64 (organization_id, data_source_id, data_source_uid, data_source_type)
On audit_control_frameworks
index_audit_control_frameworks_on_audit_control_id (audit_control_id)
is covered by
index_audit_control_frameworks_on_audit_control_and_framework (audit_control_id, framework_id)
On audit_control_test_results
index_audit_control_test_results_on_audit_result_id (audit_result_id)
is covered by
index_audit_control_test_results_on_result_and_test (audit_result_id, audit_control_test_id)
On call_behavioral_risk_indicator_results
index_call_behavioral_risk_indicator_results_on_call_id (call_id)
is covered by
idx_on_call_id_risk_indicator_id_c0a0f39f8a (call_id, risk_indicator_id)
On calls
index_calls_on_data_source_id (data_source_id)
is covered by
index_calls_on_data_source_id_and_data_source_uid (data_source_id, data_source_uid)
On companies
index_companies_on_organization_data_source_id (organization_data_source_id)
is covered by
index_companies_on_organization_data_source_id_and_external_id (organization_data_source_id, external_id)
On company_field_values
index_company_field_values_on_company_id (company_id)
is covered by
idx_on_company_id_company_field_id (company_id, company_field_id)
On company_fields
index_company_fields_on_organization_data_source_id (organization_data_source_id)
is covered by
idx_on_organization_data_source_id_external_id_company_fields (organization_data_source_id, external_id)
On complaint_theme_snapshot_complaints
idx_on_complaint_theme_snapshot_id_fc76ec58fb (complaint_theme_snapshot_id)
is covered by
idx_on_complaint_theme_snapshot_id_customer_complai_fef9489f14 (complaint_theme_snapshot_id, customer_complaint_id)
On conversation_agents
index_conversation_agents_on_conversation_id (conversation_id)
is covered by
index_conversation_agents_on_conversation_id_and_employee_id (conversation_id, employee_id)
On conversation_agents
index_conversation_agents_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_id_employee_id_7c78b5fdef (organization_id, conversation_id, employee_id)
On conversation_assignee_accounts
index_conversation_assignee_accounts_on_conversation_id (conversation_id)
is covered by
idx_on_conversation_id_account_id_12d98858e4 (conversation_id, account_id)
On conversation_assignee_roles
index_conversation_assignee_roles_on_conversation_id (conversation_id)
is covered by
idx_on_conversation_id_role_id_2085ecbc39 (conversation_id, role_id)
On conversation_customer_sentiment_summaries
idx_on_organization_id_d48e480ccf (organization_id)
is covered by
idx_on_organization_id_conversation_id_e83848cf45 (organization_id, conversation_id)
On conversation_customers
index_conversation_customers_on_conversation_id (conversation_id)
is covered by
index_conversation_customers_on_conversation_id_and_client_id (conversation_id, client_id)
On conversation_customers
index_conversation_customers_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_id_client_id_eaec47de48 (organization_id, conversation_id, client_id)
On conversation_cx_risk_indicator_results
idx_on_conversation_id_4c22ef40a3 (conversation_id)
is covered by
idx_on_conversation_id_name_bf9e40767d (conversation_id, name)
On conversation_cx_risk_snapshot_assignee_accounts
idx_on_conversation_cx_risk_snapshot_id_9254f05dc4 (conversation_cx_risk_snapshot_id)
is covered by
idx_on_conversation_cx_risk_snapshot_id_account_id_4e2b02cbec (conversation_cx_risk_snapshot_id, account_id)
On conversation_cx_risk_snapshot_assignee_roles
idx_on_conversation_cx_risk_snapshot_id_6fbbdcec7c (conversation_cx_risk_snapshot_id)
is covered by
idx_on_conversation_cx_risk_snapshot_id_role_id_6f765ea16e (conversation_cx_risk_snapshot_id, role_id)
On conversation_cx_risk_snapshot_scorecard_criterion_results
idx_on_conversation_cx_risk_snapshot_scorecard_resu_a09a2aca21 (conversation_cx_risk_snapshot_scorecard_result_id)
is covered by
idx_on_conversation_cx_risk_snapshot_scorecard_resu_e3811c2d48 (conversation_cx_risk_snapshot_scorecard_result_id, scorecard_criterion_id)
On conversation_cx_risk_snapshots
index_conversation_cx_risk_snapshots_on_organization_id (organization_id)
is covered by
index_conversation_cx_risk_snapshots_on_organization_id_and_id (organization_id, id)
On conversation_field_values
index_conversation_field_values_on_conversation_id (conversation_id)
is covered by
idx_on_conversation_id_conversation_field_id_14c46ba24a (conversation_id, conversation_field_id)
On conversation_fields
index_conversation_fields_on_organization_data_source_id (organization_data_source_id)
is covered by
idx_on_organization_data_source_id_external_id_62ba15d06e (organization_data_source_id, external_id)
On conversation_filter_results
index_conversation_filter_results_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_filter_id_conve_dcfaf571ee (organization_id, conversation_filter_id, conversation_id)
On conversation_groups
index_conversation_groups_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_id_group_id_241a632ddf (organization_id, conversation_id, group_id)
On conversation_partners
index_conversation_partners_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_id_partner_id_87c2b87e57 (organization_id, conversation_id, partner_id)
On conversation_parts
index_conversation_parts_on_author_employee_id (author_employee_id)
is covered by
idx_conversation_parts_employee_author_type (author_employee_id, author_type)
On conversation_parts
index_conversation_parts_on_conversation_id (conversation_id)
is covered by
idx_conversation_parts_conversation_author_type (conversation_id, author_type)
On conversation_relationships
index_conversation_relationships_on_conversation_id (conversation_id)
is covered by
index_conversation_relationships_on_conv_and_entity_created_at (conversation_id, entity_created_at)
On conversation_resolution_assignment_rule_assignee_accounts
idx_on_conversation_resolution_assignment_rule_id_426032d977 (conversation_resolution_assignment_rule_id)
is covered by
idx_on_conversation_resolution_assignment_rule_id_a_01b92edf83 (conversation_resolution_assignment_rule_id, account_id)
On conversation_resolution_assignment_rule_assignee_roles
idx_on_conversation_resolution_assignment_rule_id_71f70ad8f3 (conversation_resolution_assignment_rule_id)
is covered by
idx_on_conversation_resolution_assignment_rule_id_r_751f130d27 (conversation_resolution_assignment_rule_id, role_id)
On conversation_sla_applications
index_conversation_sla_applications_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_id_sla_policy_i_6774c91679 (organization_id, conversation_id, sla_policy_id)
On conversations
index_conversations_on_customer_issue_id (customer_issue_id)
is covered by
index_conversations_on_customer_issue_id_and_started_at_and_id (customer_issue_id, started_at, id)
On conversations
index_conversations_on_organization_id (organization_id)
is covered by
idx_on_organization_id_interaction_type_service_iss_06824fffbf (organization_id, interaction_type, service_issue_risk_level)
On conversations
idx_on_organization_id_interaction_type_complaint_r_512c2730b7 (organization_id, interaction_type, complaint_risk_level)
is covered by
idx_on_organization_id_interaction_type_complaint_r_4f39f79da0 (organization_id, interaction_type, complaint_risk_level, external_created_at DESC, created_at DESC)
On conversations
idx_on_organization_id_interaction_type_compliance__15c7b570ac (organization_id, interaction_type, compliance_risk_level)
is covered by
idx_on_organization_id_interaction_type_compliance__2c5a1b0478 (organization_id, interaction_type, compliance_risk_level, external_created_at DESC, created_at DESC)
On conversations
idx_on_organization_id_interaction_type_dispute_ris_1c9318ac66 (organization_id, interaction_type, dispute_risk_level)
is covered by
idx_on_organization_id_interaction_type_dispute_ris_df1730f4e7 (organization_id, interaction_type, dispute_risk_level, external_created_at DESC, created_at DESC)
On conversations
idx_on_organization_id_interaction_type_product_iss_4ffb30086e (organization_id, interaction_type, product_issue_risk_level)
is covered by
idx_on_organization_id_interaction_type_product_iss_f34e0d4233 (organization_id, interaction_type, product_issue_risk_level, external_created_at DESC, created_at DESC)
On conversations
idx_on_organization_id_interaction_type_risk_level_0a0a93fffd (organization_id, interaction_type, risk_level)
is covered by
idx_on_organization_id_interaction_type_risk_level__e9fff4d231 (organization_id, interaction_type, risk_level, external_created_at DESC, created_at DESC)
On conversations
idx_on_organization_id_interaction_type_service_iss_06824fffbf (organization_id, interaction_type, service_issue_risk_level)
is covered by
idx_on_organization_id_interaction_type_service_iss_f563320fb2 (organization_id, interaction_type, service_issue_risk_level, external_created_at DESC, created_at DESC)
On conversations
idx_on_organization_id_interaction_type_started_at_44de9acb05 (organization_id, interaction_type, started_at)
is covered by
idx_on_organization_id_interaction_type_started_at__43bf513fd0 (organization_id, interaction_type, started_at, active_evaluation_id)
On customer_companies
index_customer_companies_on_client_id (client_id)
is covered by
index_customer_companies_on_client_id_and_company_id (client_id, company_id)
On customer_complaint_assignee_accounts
idx_on_customer_complaint_id_064d6f5bf4 (customer_complaint_id)
is covered by
idx_on_customer_complaint_id_account_id_bc622dcb1f (customer_complaint_id, account_id)
On customer_complaint_assignee_roles
idx_on_customer_complaint_id_d994db35f6 (customer_complaint_id)
is covered by
idx_on_customer_complaint_id_role_id_d4e12869ee (customer_complaint_id, role_id)
On customer_complaint_categorizations
idx_on_customer_complaint_id_9e56a42434 (customer_complaint_id)
is covered by
idx_on_customer_complaint_id_customer_complaint_cat_e99dde36ca (customer_complaint_id, customer_complaint_category_id)
On customer_complaint_category_keywords
idx_on_customer_complaint_category_id_fcaa616bae (customer_complaint_category_id)
is covered by
idx_on_customer_complaint_category_id_text_84edc2cdff (customer_complaint_category_id, text)
On customer_complaint_conversations
idx_on_customer_complaint_id_6ca8c79343 (customer_complaint_id)
is covered by
idx_on_customer_complaint_id_conversation_id_a0da51d357 (customer_complaint_id, conversation_id)
On customer_complaints
index_customer_complaints_on_organization_id (organization_id)
is covered by
idx_on_organization_id_priority_int_created_at_stat_87d6b788e7 (organization_id, priority_int DESC, created_at DESC, status)
On customer_field_values
index_customer_field_values_on_client_id (client_id)
is covered by
idx_on_client_id_customer_field_id (client_id, customer_field_id)
On customer_fields
index_customer_fields_on_organization_data_source_id (organization_data_source_id)
is covered by
idx_on_organization_data_source_id_external_id_customer_fields (organization_data_source_id, external_id)
On customer_issue_conversation_fields
index_customer_issue_conversation_fields_on_organization_id (organization_id)
is covered by
idx_on_organization_id_conversation_field_id_112947eb09 (organization_id, conversation_field_id)
On customer_issue_theme_snapshot_conversations
idx_on_customer_issue_theme_snapshot_id_8805247ed5 (customer_issue_theme_snapshot_id)
is covered by
idx_on_customer_issue_theme_snapshot_id_conversatio_a4759838c2 (customer_issue_theme_snapshot_id, conversation_id)
On customer_issues
index_customer_issues_on_organization_id (organization_id)
is covered by
index_customer_issues_on_organization_id_and_type_and_id (organization_id, type, id) INCLUDE (public_id, name, description)
On dashboard_filter_rules
index_dashboard_filter_rules_on_dashboard_id (dashboard_id)
is covered by
index_dashboard_filter_rules_on_dashboard_id_and_type (dashboard_id, type)
On dashboard_widget_types
index_dashboard_widget_types_on_dashboard_widget_type_group_id (dashboard_widget_type_group_id)
is covered by
idx_on_dashboard_widget_type_group_id_position_ab99d05ac1 (dashboard_widget_type_group_id, position)
On dashboard_widgets
index_dashboard_widgets_on_dashboard_id (dashboard_id)
is covered by
index_dashboard_widgets_on_dashboard_id_and_position (dashboard_id, position)
On employee_field_values
index_employee_field_values_on_employee_id (employee_id)
is covered by
idx_on_employee_id_employee_field_id (employee_id, employee_field_id)
On employee_fields
index_employee_fields_on_organization_data_source_id (organization_data_source_id)
is covered by
idx_on_organization_data_source_id_external_id_employee_fields (organization_data_source_id, external_id)
On employees
index_employees_on_organization_id (organization_id)
is covered by
index_employees_on_organization_id_and_phone (organization_id, phone)
On evaluation_assignments
index_evaluation_assignments_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_assignments_on_batch_and_status (evaluation_batch_id, status)
On evaluation_batch_accounts
index_evaluation_batch_accounts_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_accounts_on_batch_and_account (evaluation_batch_id, account_id)
On evaluation_batch_assignees
index_evaluation_batch_assignees_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_assignees_on_batch_and_evaluator (evaluation_batch_id, evaluator_id)
On evaluation_batch_channels
index_evaluation_batch_channels_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_channels_on_batch_and_channel (evaluation_batch_id, channel)
On evaluation_batch_conversation_check_comments
idx_on_evaluation_batch_conversation_review_id_ac87a427f9 (evaluation_batch_conversation_review_id)
is covered by
idx_check_comments_on_review_and_check (evaluation_batch_conversation_review_id, scorecard_criterion_check_id)
On evaluation_batch_conversation_check_result_reactions
idx_on_evaluation_batch_conversation_review_id_401c40c52b (evaluation_batch_conversation_review_id)
is covered by
idx_check_result_reactions_on_review_and_check_result (evaluation_batch_conversation_review_id, qa_agent_evaluation_scorecard_criterion_check_result_id)
On evaluation_batch_conversation_reviews
idx_on_evaluation_batch_conversation_id_c69a29d99a (evaluation_batch_conversation_id)
is covered by
idx_eval_batch_conv_reviews_on_batch_conv_and_evaluator (evaluation_batch_conversation_id, evaluator_membership_id)
On evaluation_batch_conversations
index_evaluation_batch_conversations_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_on_evaluation_batch_id_conversation_id_b9a661981b (evaluation_batch_id, conversation_id)
On evaluation_batch_groups
index_evaluation_batch_groups_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_groups_on_batch_and_group (evaluation_batch_id, group_id)
On evaluation_batch_roles
index_evaluation_batch_roles_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_roles_on_batch_and_role (evaluation_batch_id, role_id)
On evaluation_batch_scorecards
index_evaluation_batch_scorecards_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_scorecards_on_batch_and_scorecard (evaluation_batch_id, scorecard_id)
On evaluation_batch_zendesk_brands
index_evaluation_batch_zendesk_brands_on_evaluation_batch_id (evaluation_batch_id)
is covered by
idx_eval_batch_zendesk_brands_on_batch_and_brand (evaluation_batch_id, zendesk_brand_id)
On evaluation_batches
index_evaluation_batches_on_evaluation_schedule_id (evaluation_schedule_id)
is covered by
idx_eval_batches_on_schedule_and_status (evaluation_schedule_id, status)
On evaluation_batches
index_evaluation_batches_on_organization_id (organization_id)
is covered by
index_evaluation_batches_on_organization_id_and_status (organization_id, status)
On evaluation_checks
index_evaluation_checks_on_conversation_cx_risk_snapshot_id (conversation_cx_risk_snapshot_id)
is covered by
idx_on_conversation_cx_risk_snapshot_id_type_931cfa9180 (conversation_cx_risk_snapshot_id, type)
On evaluation_compliance_criterion_group_results
idx_on_conversation_cx_risk_snapshot_id_7177d5eea0 (conversation_cx_risk_snapshot_id)
is covered by
idx_on_conversation_cx_risk_snapshot_id_compliance__5c01ae4ab0 (conversation_cx_risk_snapshot_id, compliance_criterion_group_id)
On evaluation_compliance_criterion_results
idx_on_evaluation_compliance_criterion_group_result_7cc6ff7daa (evaluation_compliance_criterion_group_result_id)
is covered by
idx_on_evaluation_compliance_criterion_group_result_d68defa394 (evaluation_compliance_criterion_group_result_id, compliance_criterion_id)
On evaluation_contest_scorecard_criterion_results
idx_on_evaluation_contest_id_ad6d4d521c (evaluation_contest_id)
is covered by
idx_on_evaluation_contest_id_conversation_cx_risk_s_432544ea57 (evaluation_contest_id, conversation_cx_risk_snapshot_scorecard_criterion_result_id)
On evaluation_eligibility_rules
index_evaluation_eligibility_rules_on_organization_id (organization_id)
is covered by
idx_evaluation_eligibility_rules_org_ods_field (organization_id, organization_data_source_id, field)
On evaluation_guiding_question_answers
idx_on_conversation_cx_risk_snapshot_scorecard_crit_73fa1010e0 (conversation_cx_risk_snapshot_scorecard_criterion_result_id)
is covered by
idx_on_conversation_cx_risk_snapshot_scorecard_crit_6262f4b2db (conversation_cx_risk_snapshot_scorecard_criterion_result_id, guiding_question_id)
On evaluation_sampling_rule_counters
index_evaluation_sampling_rule_counters_on_organization_id (organization_id)
is covered by
idx_eval_sampling_rule_counters_unique (organization_id, evaluation_sampling_rule_id, period_start)
On evaluation_sampling_rule_targets
idx_on_evaluation_sampling_rule_id_42a24d7591 (evaluation_sampling_rule_id)
is covered by
idx_on_evaluation_sampling_rule_id_target_type_targ_0569b9e86a (evaluation_sampling_rule_id, target_type, target_id)
On evaluation_schedule_accounts
index_evaluation_schedule_accounts_on_evaluation_schedule_id (evaluation_schedule_id)
is covered by
idx_eval_schedule_accounts_on_schedule_and_account (evaluation_schedule_id, account_id)
On evaluation_schedule_channels
index_evaluation_schedule_channels_on_evaluation_schedule_id (evaluation_schedule_id)
is covered by
idx_eval_schedule_channels_on_schedule_and_channel (evaluation_schedule_id, channel)
On evaluation_schedule_conversations
idx_on_evaluation_schedule_id_2ec5d7dfe3 (evaluation_schedule_id)
is covered by
idx_eval_schedule_conversations_on_schedule_and_conversation (evaluation_schedule_id, conversation_id)
On evaluation_schedule_groups
index_evaluation_schedule_groups_on_evaluation_schedule_id (evaluation_schedule_id)
is covered by
idx_eval_schedule_groups_on_schedule_and_group (evaluation_schedule_id, group_id)
On evaluation_schedule_roles
index_evaluation_schedule_roles_on_evaluation_schedule_id (evaluation_schedule_id)
is covered by
idx_eval_schedule_roles_on_schedule_and_role (evaluation_schedule_id, role_id)
On evaluation_schedule_scorecards
index_evaluation_schedule_scorecards_on_evaluation_schedule_id (evaluation_schedule_id)
is covered by
idx_eval_schedule_scorecards_on_schedule_and_scorecard (evaluation_schedule_id, scorecard_id)
On evaluation_schedule_zendesk_brands
idx_on_evaluation_schedule_id_b3cbdbbdc9 (evaluation_schedule_id)
is covered by
idx_eval_schedule_zendesk_brands_on_schedule_and_brand (evaluation_schedule_id, zendesk_brand_id)
On evaluation_schedules
index_evaluation_schedules_on_organization_id (organization_id)
is covered by
index_evaluation_schedules_on_organization_id_and_status (organization_id, status)
On group_employees
index_group_employees_on_organization_id (organization_id)
is covered by
idx_on_organization_id_group_id_employee_id_cfcbf11f9e (organization_id, group_id, employee_id)
On group_memberships
index_group_memberships_on_membership_id (membership_id)
is covered by
index_group_memberships_on_membership_id_and_group_id (membership_id, group_id)
On groups
index_groups_on_organization_id (organization_id)
is covered by
index_groups_on_organization_id_and_type (organization_id, type)
On invitation_scopes
index_invitation_scopes_on_organization_id (organization_id)
is covered by
index_invitation_scopes_on_organization_id_and_invitation_id (organization_id, invitation_id)
On invitation_scopes
index_invitation_scopes_on_scope_type_and_scope_id (scope_type, scope_id)
is covered by
index_invitation_scopes_on_scope (scope_type, scope_id)
On jira_issue_request_field_values
index_jira_issue_request_field_values_on_jira_issue_id (jira_issue_id)
is covered by
index_jira_issue_request_field_values_on_issue_and_field (jira_issue_id, jira_request_type_field_id)
On jira_request_type_fields
index_jira_request_type_fields_on_jira_request_type_id (jira_request_type_id)
is covered by
index_jira_request_type_fields_on_request_type_and_external_id (jira_request_type_id, external_id)
On jira_request_types
index_jira_request_types_on_organization_data_source_id (organization_data_source_id)
is covered by
index_jira_request_types_on_org_ds_and_external_id (organization_data_source_id, external_id)
On jira_service_desks
index_jira_service_desks_on_organization_data_source_id (organization_data_source_id)
is covered by
index_jira_service_desks_on_org_ds_and_external_id (organization_data_source_id, external_id)
On knowledge_base_document_scorecard_criteria
idx_on_knowledge_base_document_id_8ebdbd979f (knowledge_base_document_id)
is covered by
index_kb_doc_scorecard_criteria_on_unique_pair (knowledge_base_document_id, scorecard_criterion_id)
On manual_evaluation_guiding_question_answers
idx_on_manual_evaluation_scorecard_criterion_result_a8f0949c67 (manual_evaluation_scorecard_criterion_result_id)
is covered by
idx_on_manual_evaluation_scorecard_criterion_result_a694759347 (manual_evaluation_scorecard_criterion_result_id, guiding_question_id)
On manual_evaluation_scorecard_criterion_results
idx_on_manual_evaluation_scorecard_result_id_980b617d3a (manual_evaluation_scorecard_result_id)
is covered by
idx_on_manual_evaluation_scorecard_result_id_scorec_e7ed8e3398 (manual_evaluation_scorecard_result_id, scorecard_criterion_id)
On manual_evaluation_scorecard_results
idx_on_manual_evaluation_id_1d6e604059 (manual_evaluation_id)
is covered by
idx_on_manual_evaluation_id_scorecard_id_f932c2c187 (manual_evaluation_id, scorecard_id)
On membership_connection_profiles
index_membership_connection_profiles_on_membership_id (membership_id)
is covered by
index_membership_connection_profiles_on_membership_and_ds (membership_id, organization_data_source_id)
On membership_scopes
index_membership_scopes_on_organization_id (organization_id)
is covered by
index_membership_scopes_on_organization_id_and_membership_id (organization_id, membership_id)
On membership_scopes
index_membership_scopes_on_scope_type_and_scope_id (scope_type, scope_id)
is covered by
index_membership_scopes_on_scope (scope_type, scope_id)
On memberships
index_memberships_on_account_id (account_id)
is covered by
index_memberships_on_account_id_and_organization_id (account_id, organization_id)
On phishing_case_email_steps
index_phishing_case_email_steps_on_phishing_case_id (phishing_case_id)
is covered by
index_phishing_case_email_steps_on_phishing_case_id_and_order (phishing_case_id, order)
On phishing_case_sms_steps
index_phishing_case_sms_steps_on_phishing_case_id (phishing_case_id)
is covered by
index_phishing_case_sms_steps_on_phishing_case_id_and_order (phishing_case_id, order)
On phishing_case_training_run_answers
idx_on_phishing_case_training_run_id_b425c7523b (phishing_case_training_run_id)
is covered by
idx_on_phishing_case_training_run_id_phishing_case__43f6a28072 (phishing_case_training_run_id, phishing_case_training_step_id)
On phishing_case_training_step_question_content_options
idx_on_phishing_case_training_step_question_content_d4ed3e7b0b (phishing_case_training_step_question_content_id)
is covered by
idx_on_phishing_case_training_step_question_content_acd60b2b41 (phishing_case_training_step_question_content_id, order)
On phishing_case_training_steps
index_phishing_case_training_steps_on_phishing_case_id (phishing_case_id)
is covered by
idx_on_phishing_case_id_order_786ffe79a6 (phishing_case_id, order)
On pinned_conversations
index_pinned_conversations_on_employee_id (employee_id)
is covered by
idx_pinned_conversations_employee_conversation (employee_id, conversation_id)
On qa_agent_evaluation_guiding_question_answers
idx_on_qa_agent_evaluation_scorecard_criterion_resu_6b6fb624c8 (qa_agent_evaluation_scorecard_criterion_result_id)
is covered by
idx_on_qa_agent_evaluation_scorecard_criterion_resu_f0f11fa6cc (qa_agent_evaluation_scorecard_criterion_result_id, guiding_question_id)
On qa_agent_evaluation_scorecard_criterion_check_results
idx_on_qa_agent_evaluation_scorecard_criterion_resu_c66f17ba2b (qa_agent_evaluation_scorecard_criterion_result_id)
is covered by
idx_on_qa_agent_evaluation_scorecard_criterion_resu_a45746baf8 (qa_agent_evaluation_scorecard_criterion_result_id, scorecard_criterion_check_id)
On qa_agent_evaluation_scorecard_criterion_results
idx_on_qa_agent_evaluation_scorecard_result_id_89de694f41 (qa_agent_evaluation_scorecard_result_id)
is covered by
idx_on_qa_agent_evaluation_scorecard_result_id_scor_8926794d45 (qa_agent_evaluation_scorecard_result_id, scorecard_criterion_id)
On qa_agent_evaluation_scorecard_results
idx_on_qa_agent_evaluation_id_8dbc670dd0 (qa_agent_evaluation_id)
is covered by
idx_on_qa_agent_evaluation_id_scorecard_id_6fb17c5320 (qa_agent_evaluation_id, scorecard_id)
On qa_agent_evaluations
index_qa_agent_evaluations_on_conversation_id (conversation_id)
is covered by
idx_on_conversation_id_source_active_0cf3ed6dc0 (conversation_id, source, active)
On qa_agent_evaluations
index_qa_agent_evaluations_on_organization_id (organization_id)
is covered by
index_qa_agent_evaluations_on_org_conv_active (organization_id, conversation_id, active)
On qa_evaluations
index_qa_evaluations_on_organization_id (organization_id)
is covered by
index_qa_evaluations_on_organization_id_and_conversation_id (organization_id, conversation_id)
On risk_frameworks
index_risk_frameworks_on_organization_id (organization_id)
is covered by
index_risk_frameworks_on_organization_id_and_reference (organization_id, reference)
On risk_indicator_groups
index_risk_indicator_groups_on_risk_framework_id (risk_framework_id)
is covered by
index_risk_indicator_groups_on_risk_framework_id_and_reference (risk_framework_id, reference)
On role_permissions
index_role_permissions_on_role_id (role_id)
is covered by
index_role_permissions_on_role_id_and_permission_id (role_id, permission_id)
On scorecard_conditions
index_scorecard_conditions_on_scorecard_id (scorecard_id)
is covered by
index_scorecard_conditions_on_scorecard_id_and_condition_type (scorecard_id, condition_type)
On scorecard_criteria
index_scorecard_criteria_on_scorecard_id (scorecard_id)
is covered by
idx_on_scorecard_id_parent_id_position_54e0381e4d (scorecard_id, parent_id, position)
On scorecard_criterion_check_conditions
idx_on_scorecard_criterion_check_id_2ea52186aa (scorecard_criterion_check_id)
is covered by
index_scorecard_criterion_check_conditions_on_check_and_field (scorecard_criterion_check_id, field)
On scorecard_criterion_checks
index_scorecard_criterion_checks_on_scorecard_criterion_id (scorecard_criterion_id)
is covered by
idx_on_scorecard_criterion_id_position_ce11d13726 (scorecard_criterion_id, position)
On scorecard_groups
index_scorecard_groups_on_scorecard_id (scorecard_id)
is covered by
index_scorecard_groups_on_scorecard_id_and_group_id (scorecard_id, group_id)
On scoring_guides
index_scoring_guides_on_organization_id (organization_id)
is covered by
index_scoring_guides_on_organization_id_and_reference (organization_id, reference)
On sla_breaches
index_sla_breaches_on_conversation_id (conversation_id)
is covered by
idx_sla_breaches_conversation_type (conversation_id, type)
On slack_channels
index_slack_channels_on_organization_id (organization_id)
is covered by
index_slack_channels_on_organization_id_and_external_id (organization_id, external_id)
On slack_messages
index_slack_messages_on_organization_id (organization_id)
is covered by
index_slack_messages_on_organization_id_and_url (organization_id, url)
On social_media_risk_event_posts
idx_on_social_media_risk_event_id_baee004268 (social_media_risk_event_id)
is covered by
idx_on_social_media_risk_event_id_social_media_post_7f49c7be89 (social_media_risk_event_id, social_media_post_id)
On view_columns
index_view_columns_on_view_id (view_id)
is covered by
index_view_columns_on_view_id_and_path (view_id, path)
On zendesk_brands
index_zendesk_brands_on_organization_data_source_id (organization_data_source_id)
is covered by
idx_zendesk_brands_org_data_source_external_id (organization_data_source_id, external_id)

Suggested Indexes

Add indexes to speed up queries.

rails generate migration add_suggested_indexes

And paste

commit_db_transaction
add_index :clients, [:phone], algorithm: :concurrently
add_index :good_jobs, [:concurrency_key, :created_at], algorithm: :concurrently
add_index :good_jobs, [:finished_at], algorithm: :concurrently
add_index :good_jobs, [:scheduled_at], algorithm: :concurrently

Details
CREATE INDEX CONCURRENTLY ON clients (phone)
Rows: 743769
Row progression: 743769, 1

Row estimates
- phone (=): 1
- organization_id (=): 148754

Existing indexes
- id PRIMARY
- data_source_id
- organization_data_source_id
- organization_id
- organization_id, data_source_id, data_source_uid WHERE (data_source_id IS NOT NULL) AND (data_source_uid IS NOT NULL) UNIQUE
- organization_id, user_id WHERE user_id IS NOT NULL UNIQUE
- public_id UNIQUE

to speed up

Total Time Average Time Calls
79 min < 0.1% 350 ms 13,617 flightcontrol
SELECT "clients".* FROM "clients" WHERE "clients"."organization_id" = $1 AND "clients"."phone" = $2 LIMIT $3

Details
CREATE INDEX CONCURRENTLY ON good_jobs (concurrency_key, created_at)
Rows: 317419
Row progression: 317419, 70, 7

Row estimates
- concurrency_key (=): 70
- created_at (>): 31742

Existing indexes
- id PRIMARY
- active_job_id, created_at
- batch_callback_id WHERE batch_callback_id IS NOT NULL
- batch_id WHERE batch_id IS NOT NULL
- concurrency_key WHERE finished_at IS NULL
- cron_key, created_at WHERE cron_key IS NOT NULL
- cron_key, cron_at WHERE cron_key IS NOT NULL UNIQUE
- finished_at WHERE (retried_good_job_id IS NULL) AND (finished_at IS NOT NULL)
- labels WHERE labels IS NOT NULL GIN
- locked_by_id WHERE locked_by_id IS NOT NULL
- priority, created_at WHERE finished_at IS NULL
- priority, scheduled_at WHERE (finished_at IS NULL) AND (locked_by_id IS NULL)
- priority DESC NULLS LAST, created_at WHERE finished_at IS NULL
- queue_name, scheduled_at WHERE finished_at IS NULL
- scheduled_at WHERE finished_at IS NULL

to speed up

Total Time Average Time Calls
564 min 0.5% 40 ms 849,194 flightcontrol
SELECT COUNT(*) FROM "good_jobs" WHERE "good_jobs"."concurrency_key" = $1 AND "good_jobs"."created_at" > $2

Details
CREATE INDEX CONCURRENTLY ON good_jobs (finished_at)
Rows: 317419
Row progression: 317419, 20356

Row estimates
- finished_at (<=): 20356
- finished_at (sort): 1

Existing indexes
- id PRIMARY
- active_job_id, created_at
- batch_callback_id WHERE batch_callback_id IS NOT NULL
- batch_id WHERE batch_id IS NOT NULL
- concurrency_key WHERE finished_at IS NULL
- cron_key, created_at WHERE cron_key IS NOT NULL
- cron_key, cron_at WHERE cron_key IS NOT NULL UNIQUE
- finished_at WHERE (retried_good_job_id IS NULL) AND (finished_at IS NOT NULL)
- labels WHERE labels IS NOT NULL GIN
- locked_by_id WHERE locked_by_id IS NOT NULL
- priority, created_at WHERE finished_at IS NULL
- priority, scheduled_at WHERE (finished_at IS NULL) AND (locked_by_id IS NULL)
- priority DESC NULLS LAST, created_at WHERE finished_at IS NULL
- queue_name, scheduled_at WHERE finished_at IS NULL
- scheduled_at WHERE finished_at IS NULL

to speed up

Total Time Average Time Calls
63 min < 0.1% 202 ms 18,780 flightcontrol
SELECT "good_jobs"."active_job_id" FROM "good_jobs" WHERE "good_jobs"."finished_at" <= $1 ORDER BY "good_jobs"."finished_at" ASC LIMIT $2

Details
CREATE INDEX CONCURRENTLY ON good_jobs (scheduled_at)
Rows: 317419
Row progression: 317419, 31742

Row estimates
- scheduled_at (<=): 31742
- finished_at (null): 113858

Existing indexes
- id PRIMARY
- active_job_id, created_at
- batch_callback_id WHERE batch_callback_id IS NOT NULL
- batch_id WHERE batch_id IS NOT NULL
- concurrency_key WHERE finished_at IS NULL
- cron_key, created_at WHERE cron_key IS NOT NULL
- cron_key, cron_at WHERE cron_key IS NOT NULL UNIQUE
- finished_at WHERE (retried_good_job_id IS NULL) AND (finished_at IS NOT NULL)
- labels WHERE labels IS NOT NULL GIN
- locked_by_id WHERE locked_by_id IS NOT NULL
- priority, created_at WHERE finished_at IS NULL
- priority, scheduled_at WHERE (finished_at IS NULL) AND (locked_by_id IS NULL)
- priority DESC NULLS LAST, created_at WHERE finished_at IS NULL
- queue_name, scheduled_at WHERE finished_at IS NULL
- scheduled_at WHERE finished_at IS NULL

to speed up

Total Time Average Time Calls
62 min < 0.1% 55 ms 67,595 flightcontrol
SELECT EXTRACT($1 FROM NOW() - MIN(created_at)) AS latency_seconds FROM good_jobs WHERE finished_at IS NULL AND scheduled_at <= NOW()

Slow Queries

Slow queries take 20 ms or more on average and have been called at least 100 times.

Explain queries to see where to add indexes.

Total Time Average Time Calls
115,791 min 94% 153 ms 45,308,478 flightcontrol
SELECT "good_jobs"."id", "good_jobs"."queue_name", "good_jobs"."priority", "good_jobs"."serialized_params", "good_jobs"."scheduled_at", "good_jobs"."performed_at", "good_jobs"."finished_at", "good_jobs"."error", "good_jobs"."created_at", "good_jobs"."updated_at", "good_jobs"."active_job_id", "good_jobs"."concurrency_key", "good_jobs"."cron_key", "good_jobs"."cron_at", "good_jobs"."batch_id", "good_jobs"."batch_callback_id", "good_jobs"."executions_count", "good_jobs"."job_class", "good_jobs"."error_event", "good_jobs"."labels", "good_jobs"."locked_by_id", "good_jobs"."locked_at" FROM "good_jobs" WHERE "good_jobs"."id" IN (WITH "rows" AS  MATERIALIZED (SELECT "good_jobs"."id" FROM "good_jobs" WHERE "good_jobs"."finished_at" IS NULL AND "good_jobs"."scheduled_at" <= $1 ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC) SELECT "rows"."id" FROM "rows" WHERE pg_try_advisory_lock(($3 || substr(md5($4 || $5 || "rows"."id"::text), $6, $7))::bit(64)::bigint) LIMIT $2) ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC
564 min 0.5% 40 ms 849,194 flightcontrol
SELECT COUNT(*) FROM "good_jobs" WHERE "good_jobs"."concurrency_key" = $1 AND "good_jobs"."created_at" > $2
Details
CREATE INDEX CONCURRENTLY ON good_jobs (concurrency_key, created_at)
Rows: 317419
Row progression: 317419, 70, 7

Row estimates
- concurrency_key (=): 70
- created_at (>): 31742

Existing indexes
- id PRIMARY
- active_job_id, created_at
- batch_callback_id WHERE batch_callback_id IS NOT NULL
- batch_id WHERE batch_id IS NOT NULL
- concurrency_key WHERE finished_at IS NULL
- cron_key, created_at WHERE cron_key IS NOT NULL
- cron_key, cron_at WHERE cron_key IS NOT NULL UNIQUE
- finished_at WHERE (retried_good_job_id IS NULL) AND (finished_at IS NOT NULL)
- labels WHERE labels IS NOT NULL GIN
- locked_by_id WHERE locked_by_id IS NOT NULL
- priority, created_at WHERE finished_at IS NULL
- priority, scheduled_at WHERE (finished_at IS NULL) AND (locked_by_id IS NULL)
- priority DESC NULLS LAST, created_at WHERE finished_at IS NULL
- queue_name, scheduled_at WHERE finished_at IS NULL
- scheduled_at WHERE finished_at IS NULL
503 min 0.4% 54 ms 563,062 flightcontrol
SELECT "good_job_executions"."active_job_id" FROM "good_job_executions" INNER JOIN "good_jobs" ON "good_jobs"."id" = "good_job_executions"."active_job_id" WHERE "good_jobs"."concurrency_key" = $1 AND "good_job_executions"."created_at" > $2 AND ("good_job_executions"."error" IS NULL OR "good_job_executions"."error" != $3) ORDER BY "good_job_executions"."created_at" ASC LIMIT $4
358 min 0.3% 29 ms 733,055 flightcontrol
UPDATE "conversations" SET "sla_breach_last_checked_at" = $1 WHERE "conversations"."id" = $2
Covered by index on (id)
Rows: 1443042
Row progression: 1443042, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- active_evaluation_id
- agent_knowledge_gap_id
- assignee_id
- assignee_membership_id
- channel_types GIN
- client_id
- closed_at
- company_id
- compliance_review_id
- conversation_thread_id
- conversation_upload_id WHERE conversation_upload_id IS NOT NULL UNIQUE
- customer_account_id
- customer_issue_id
- customer_issue_id, started_at, id
- data_source_id
- duplicate_of_id
- employee_id
- evaluation_state
- first_agent_reply_at
- first_agent_response_at
- first_customer_message_at
- first_customer_response_at
- first_responder_id
- group_id
- interaction_type
- jira_issue_key WHERE jira_issue_key IS NOT NULL
- jira_request_type_id
- jira_service_desk_id
- organization_data_source_id
- organization_id
- organization_id, closed_at WHERE handling_time IS NOT NULL
- organization_id, closed_at) INCLUDE (id, handling_time WHERE handling_time IS NOT NULL
- organization_id, data_source_id, external_id WHERE (data_source_id IS NOT NULL) AND (external_id IS NOT NULL) UNIQUE
- organization_id, interaction_type, complaint_risk_level
- organization_id, interaction_type, complaint_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, compliance_risk_level
- organization_id, interaction_type, compliance_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, dispute_risk_level
- organization_id, interaction_type, dispute_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, product_issue_risk_level
- organization_id, interaction_type, product_issue_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, qa_risk_level
- organization_id, interaction_type, risk_level
- organization_id, interaction_type, risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, service_issue_risk_level
- organization_id, interaction_type, service_issue_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, started_at
- organization_id, interaction_type, started_at, active_evaluation_id
- organization_id, interaction_type, ticket_status, qa_risk_level, external_created_at DESC, created_at DESC
- organization_id, started_at
- organization_id, started_at) INCLUDE (qa_score_effective
- public_id UNIQUE
- qa_auto_fail
- qa_score_updated_at
- reference_id WHERE reference_id IS NOT NULL UNIQUE
- requester_employee_id
- requester_id
- resolved_at
- resolver_id
- search_vector GIN
- sla_breach_last_checked_at
- started_at
- ticket_status
- transcription_state
- translation_state
- zendesk_brand_id
79 min < 0.1% 350 ms 13,617 flightcontrol
SELECT "clients".* FROM "clients" WHERE "clients"."organization_id" = $1 AND "clients"."phone" = $2 LIMIT $3
Details
CREATE INDEX CONCURRENTLY ON clients (phone)
Rows: 743769
Row progression: 743769, 1

Row estimates
- phone (=): 1
- organization_id (=): 148754

Existing indexes
- id PRIMARY
- data_source_id
- organization_data_source_id
- organization_id
- organization_id, data_source_id, data_source_uid WHERE (data_source_id IS NOT NULL) AND (data_source_uid IS NOT NULL) UNIQUE
- organization_id, user_id WHERE user_id IS NOT NULL UNIQUE
- public_id UNIQUE
76 min < 0.1% 26 ms 174,372 flightcontrol
SELECT a.attname, format_type(a.atttypid, a.atttypmod),
       pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
       c.collname, col_description(a.attrelid, a.attnum) AS comment,
       attidentity AS identity,
       attgenerated as attgenerated
  FROM pg_attribute a
  LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
  LEFT JOIN pg_type t ON a.atttypid = t.oid
  LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
 WHERE a.attrelid = $1::regclass
   AND a.attnum > $2 AND NOT a.attisdropped
 ORDER BY a.attnum
63 min < 0.1% 202 ms 18,780 flightcontrol
SELECT "good_jobs"."active_job_id" FROM "good_jobs" WHERE "good_jobs"."finished_at" <= $1 ORDER BY "good_jobs"."finished_at" ASC LIMIT $2
Details
CREATE INDEX CONCURRENTLY ON good_jobs (finished_at)
Rows: 317419
Row progression: 317419, 20356

Row estimates
- finished_at (<=): 20356
- finished_at (sort): 1

Existing indexes
- id PRIMARY
- active_job_id, created_at
- batch_callback_id WHERE batch_callback_id IS NOT NULL
- batch_id WHERE batch_id IS NOT NULL
- concurrency_key WHERE finished_at IS NULL
- cron_key, created_at WHERE cron_key IS NOT NULL
- cron_key, cron_at WHERE cron_key IS NOT NULL UNIQUE
- finished_at WHERE (retried_good_job_id IS NULL) AND (finished_at IS NOT NULL)
- labels WHERE labels IS NOT NULL GIN
- locked_by_id WHERE locked_by_id IS NOT NULL
- priority, created_at WHERE finished_at IS NULL
- priority, scheduled_at WHERE (finished_at IS NULL) AND (locked_by_id IS NULL)
- priority DESC NULLS LAST, created_at WHERE finished_at IS NULL
- queue_name, scheduled_at WHERE finished_at IS NULL
- scheduled_at WHERE finished_at IS NULL
62 min < 0.1% 55 ms 67,595 flightcontrol
SELECT EXTRACT($1 FROM NOW() - MIN(created_at)) AS latency_seconds FROM good_jobs WHERE finished_at IS NULL AND scheduled_at <= NOW()
Details
CREATE INDEX CONCURRENTLY ON good_jobs (scheduled_at)
Rows: 317419
Row progression: 317419, 31742

Row estimates
- scheduled_at (<=): 31742
- finished_at (null): 113858

Existing indexes
- id PRIMARY
- active_job_id, created_at
- batch_callback_id WHERE batch_callback_id IS NOT NULL
- batch_id WHERE batch_id IS NOT NULL
- concurrency_key WHERE finished_at IS NULL
- cron_key, created_at WHERE cron_key IS NOT NULL
- cron_key, cron_at WHERE cron_key IS NOT NULL UNIQUE
- finished_at WHERE (retried_good_job_id IS NULL) AND (finished_at IS NOT NULL)
- labels WHERE labels IS NOT NULL GIN
- locked_by_id WHERE locked_by_id IS NOT NULL
- priority, created_at WHERE finished_at IS NULL
- priority, scheduled_at WHERE (finished_at IS NULL) AND (locked_by_id IS NULL)
- priority DESC NULLS LAST, created_at WHERE finished_at IS NULL
- queue_name, scheduled_at WHERE finished_at IS NULL
- scheduled_at WHERE finished_at IS NULL
19 min < 0.1% 83 ms 13,649 flightcontrol
DELETE FROM "good_job_batches" WHERE ("good_job_batches"."id") IN (SELECT "good_job_batches"."id" FROM "good_job_batches" WHERE "good_job_batches"."finished_at" <= $1 LIMIT $2)
2 min < 0.1% 22 ms 6,730 flightcontrol
UPDATE "conversations" SET "first_agent_reply_at" = $1, "first_responder_id" = $2, "time_to_first_response_seconds" = $3 WHERE "conversations"."id" = $4
Covered by index on (id)
Rows: 1443042
Row progression: 1443042, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- active_evaluation_id
- agent_knowledge_gap_id
- assignee_id
- assignee_membership_id
- channel_types GIN
- client_id
- closed_at
- company_id
- compliance_review_id
- conversation_thread_id
- conversation_upload_id WHERE conversation_upload_id IS NOT NULL UNIQUE
- customer_account_id
- customer_issue_id
- customer_issue_id, started_at, id
- data_source_id
- duplicate_of_id
- employee_id
- evaluation_state
- first_agent_reply_at
- first_agent_response_at
- first_customer_message_at
- first_customer_response_at
- first_responder_id
- group_id
- interaction_type
- jira_issue_key WHERE jira_issue_key IS NOT NULL
- jira_request_type_id
- jira_service_desk_id
- organization_data_source_id
- organization_id
- organization_id, closed_at WHERE handling_time IS NOT NULL
- organization_id, closed_at) INCLUDE (id, handling_time WHERE handling_time IS NOT NULL
- organization_id, data_source_id, external_id WHERE (data_source_id IS NOT NULL) AND (external_id IS NOT NULL) UNIQUE
- organization_id, interaction_type, complaint_risk_level
- organization_id, interaction_type, complaint_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, compliance_risk_level
- organization_id, interaction_type, compliance_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, dispute_risk_level
- organization_id, interaction_type, dispute_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, product_issue_risk_level
- organization_id, interaction_type, product_issue_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, qa_risk_level
- organization_id, interaction_type, risk_level
- organization_id, interaction_type, risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, service_issue_risk_level
- organization_id, interaction_type, service_issue_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, started_at
- organization_id, interaction_type, started_at, active_evaluation_id
- organization_id, interaction_type, ticket_status, qa_risk_level, external_created_at DESC, created_at DESC
- organization_id, started_at
- organization_id, started_at) INCLUDE (qa_score_effective
- public_id UNIQUE
- qa_auto_fail
- qa_score_updated_at
- reference_id WHERE reference_id IS NOT NULL UNIQUE
- requester_employee_id
- requester_id
- resolved_at
- resolver_id
- search_vector GIN
- sla_breach_last_checked_at
- started_at
- ticket_status
- transcription_state
- translation_state
- zendesk_brand_id
2 min < 0.1% 108 ms 1,250 flightcontrol
SELECT AVG("conversations"."qa_score_effective") FROM "conversations" WHERE "conversations"."organization_id" = $1 AND "conversations"."started_at" BETWEEN $2 AND $3
Covered by index on (started_at)
Rows: 1443042
Row progression: 1443042, 144088

Row estimates
- started_at (BETWEEN): 144088
- organization_id (=): 240507

Existing indexes
- id PRIMARY
- active_evaluation_id
- agent_knowledge_gap_id
- assignee_id
- assignee_membership_id
- channel_types GIN
- client_id
- closed_at
- company_id
- compliance_review_id
- conversation_thread_id
- conversation_upload_id WHERE conversation_upload_id IS NOT NULL UNIQUE
- customer_account_id
- customer_issue_id
- customer_issue_id, started_at, id
- data_source_id
- duplicate_of_id
- employee_id
- evaluation_state
- first_agent_reply_at
- first_agent_response_at
- first_customer_message_at
- first_customer_response_at
- first_responder_id
- group_id
- interaction_type
- jira_issue_key WHERE jira_issue_key IS NOT NULL
- jira_request_type_id
- jira_service_desk_id
- organization_data_source_id
- organization_id
- organization_id, closed_at WHERE handling_time IS NOT NULL
- organization_id, closed_at) INCLUDE (id, handling_time WHERE handling_time IS NOT NULL
- organization_id, data_source_id, external_id WHERE (data_source_id IS NOT NULL) AND (external_id IS NOT NULL) UNIQUE
- organization_id, interaction_type, complaint_risk_level
- organization_id, interaction_type, complaint_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, compliance_risk_level
- organization_id, interaction_type, compliance_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, dispute_risk_level
- organization_id, interaction_type, dispute_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, product_issue_risk_level
- organization_id, interaction_type, product_issue_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, qa_risk_level
- organization_id, interaction_type, risk_level
- organization_id, interaction_type, risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, service_issue_risk_level
- organization_id, interaction_type, service_issue_risk_level, external_created_at DESC, created_at DESC
- organization_id, interaction_type, started_at
- organization_id, interaction_type, started_at, active_evaluation_id
- organization_id, interaction_type, ticket_status, qa_risk_level, external_created_at DESC, created_at DESC
- organization_id, started_at
- organization_id, started_at) INCLUDE (qa_score_effective
- public_id UNIQUE
- qa_auto_fail
- qa_score_updated_at
- reference_id WHERE reference_id IS NOT NULL UNIQUE
- requester_employee_id
- requester_id
- resolved_at
- resolver_id
- search_vector GIN
- sla_breach_last_checked_at
- started_at
- ticket_status
- transcription_state
- translation_state
- zendesk_brand_id