explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MmCC

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 41,935.519 ↑ 1.0 20 1

Limit (cost=2,298.51..2,298.52 rows=20 width=521) (actual time=41,935.507..41,935.519 rows=20 loops=1)

2. 168.172 41,935.507 ↑ 2.5 20 1

Sort (cost=2,298.51..2,298.53 rows=51 width=521) (actual time=41,935.506..41,935.507 rows=20 loops=1)

  • Sort Key: qa.qa_form_created_date__c DESC, qa.id DESC
  • Sort Method: top-N heapsort Memory: 30kB
3. 1,183.334 41,767.335 ↓ 5,519.5 281,495 1

WindowAgg (cost=0.89..2,298.24 rows=51 width=521) (actual time=41,170.757..41,767.335 rows=281,495 loops=1)

4. 1,108.824 40,584.001 ↓ 5,519.5 281,495 1

Nested Loop Left Join (cost=0.89..2,297.85 rows=51 width=321) (actual time=4.425..40,584.001 rows=281,495 loops=1)

  • Join Filter: ((ip.team__c)::text = (ipp1.team__c)::text)
  • Rows Removed by Join Filter: 6476042
5. 282.326 38,912.187 ↓ 10,425.7 281,495 1

Nested Loop Left Join (cost=0.73..2,174.21 rows=27 width=319) (actual time=3.986..38,912.187 rows=281,495 loops=1)

  • Filter: (((c.createddate >= '2018-10-04 07:00:00'::timestamp without time zone) AND (c.createddate < '2019-08-06 07:00:00'::timestamp without time zone)) OR ((sr.createddate >= '2018-10-04 07:00:00'::timestamp without time zone) A (...)
  • Rows Removed by Filter: 4331
6. 319.150 36,057.427 ↓ 6,496.0 285,826 1

Nested Loop Left Join (cost=0.62..2,080.55 rows=44 width=262) (actual time=0.377..36,057.427 rows=285,826 loops=1)

7. 282.756 25,448.541 ↓ 6,496.0 285,826 1

Nested Loop Left Join (cost=0.53..2,020.59 rows=44 width=256) (actual time=0.314..25,448.541 rows=285,826 loops=1)

8. 237.862 19,449.265 ↓ 6,496.0 285,826 1

Nested Loop Left Join (cost=0.48..2,017.03 rows=44 width=252) (actual time=0.269..19,449.265 rows=285,826 loops=1)

9. 386.130 3,490.973 ↓ 6,496.0 285,826 1

Nested Loop Left Join (cost=0.36..1,871.71 rows=44 width=185) (actual time=0.264..3,490.973 rows=285,826 loops=1)

  • Filter: (((ipq.employment_status__c)::text = 'Active'::text) OR ((COALESCE(ipq.employment_status__c, ''::character varying))::text = ''::text))
  • Rows Removed by Filter: 50
10. 358.876 3,104.843 ↓ 3,009.2 285,876 1

Nested Loop Left Join (cost=0.31..1,861.79 rows=95 width=204) (actual time=0.259..3,104.843 rows=285,876 loops=1)

11. 105.117 2,745.967 ↓ 3,009.2 285,876 1

Nested Loop (cost=0.20..1,584.17 rows=95 width=178) (actual time=0.249..2,745.967 rows=285,876 loops=1)

12. 1.154 35.574 ↓ 347.0 347 1

Nested Loop (cost=0.11..1,567.37 rows=1 width=66) (actual time=0.136..35.574 rows=347 loops=1)

13. 2.752 2.752 ↑ 1.0 348 1

Seq Scan on internal_app_permissions__c ip (cost=0.00..134.66 rows=348 width=32) (actual time=0.037..2.752 rows=348 loops=1)

  • Filter: ((employment_status__c)::text = 'Active'::text)
  • Rows Removed by Filter: 411
14. 31.668 31.668 ↑ 1.0 1 348

Index Scan using contact_idx_sfid on contact cp (cost=0.11..4.12 rows=1 width=34) (actual time=0.091..0.091 rows=1 loops=348)

  • Index Cond: ((sfid)::text = (ip.contact__c)::text)
  • Filter: ((recordtypeid)::text = '0120H000001O7IWQA0'::text)
  • Rows Removed by Filter: 0
15. 2,605.276 2,605.276 ↓ 1.5 824 347

Index Scan using hc_idx_qa_form__c_property_consultant__c on qa_form__c qa (cost=0.08..15.11 rows=561 width=169) (actual time=0.163..7.508 rows=824 loops=347)

  • Index Cond: ((property_consultant__c)::text = (cp.sfid)::text)
  • Filter: ((NOT dismiss_from_qa__c) AND ((shop_status__c)::text = ANY ('{Closed-Queued,"Closed-In Progress",Closed-Completed}'::text[])))
  • Rows Removed by Filter: 85
16. 0.000 0.000 ↓ 0.0 0 285,876

Index Scan using contact_idx_sfid on contact cq (cost=0.11..2.92 rows=1 width=26) (actual time=0.000..0.000 rows=0 loops=285,876)

  • Index Cond: ((qa.qa_reviewer__c)::text = (sfid)::text)
  • Filter: ((recordtypeid)::text = '0120H000001O7IWQA0'::text)
17. 0.000 0.000 ↓ 0.0 0 285,876

Index Scan using hc_idx_internal_app_permissions__c_contact__c on internal_app_permissions__c ipq (cost=0.06..0.10 rows=1 width=27) (actual time=0.000..0.000 rows=0 loops=285,876)

  • Index Cond: ((contact__c)::text = (cq.sfid)::text)
18. 15,720.430 15,720.430 ↑ 1.0 1 285,826

Index Scan using hcu_idx_case_sfid on "case" c (cost=0.11..3.30 rows=1 width=67) (actual time=0.055..0.055 rows=1 loops=285,826)

  • Index Cond: ((qa.case__c)::text = (sfid)::text)
19. 5,716.520 5,716.520 ↑ 1.0 1 285,826

Index Scan using account_idx_sfid on account acc (cost=0.06..0.08 rows=1 width=42) (actual time=0.020..0.020 rows=1 loops=285,826)

  • Index Cond: ((qa.case_account__c)::text = (sfid)::text)
20. 10,289.736 10,289.736 ↑ 1.0 1 285,826

Index Scan using property__c_idx_sfid on property__c pr (cost=0.08..1.36 rows=1 width=44) (actual time=0.036..0.036 rows=1 loops=285,826)

  • Index Cond: ((qa.case_property__c)::text = (sfid)::text)
21. 2,572.434 2,572.434 ↓ 0.0 0 285,826

Index Scan using service_request1__c_idx_sfid on service_request1__c sr (cost=0.11..2.12 rows=1 width=57) (actual time=0.009..0.009 rows=0 loops=285,826)

  • Index Cond: ((qa.service_request_pop__c)::text = (sfid)::text)
22. 557.613 562.990 ↑ 1.0 24 281,495

Materialize (cost=0.17..121.06 rows=24 width=28) (actual time=0.000..0.002 rows=24 loops=281,495)

23. 0.042 5.377 ↑ 1.0 24 1

Nested Loop Left Join (cost=0.17..121.04 rows=24 width=28) (actual time=0.158..5.377 rows=24 loops=1)

24. 0.487 0.487 ↑ 1.0 24 1

Index Scan using hc_idx_internal_app_permissions__c_user_profile__c on internal_app_permissions__c ipp1 (cost=0.06..22.23 rows=24 width=32) (actual time=0.067..0.487 rows=24 loops=1)

  • Index Cond: ((user_profile__c)::text = 'Supervisor'::text)
25. 4.848 4.848 ↑ 1.0 1 24

Index Scan using contact_idx_sfid on contact coo (cost=0.11..4.12 rows=1 width=34) (actual time=0.202..0.202 rows=1 loops=24)

  • Index Cond: ((ipp1.contact__c)::text = (sfid)::text)
  • Filter: ((recordtypeid)::text = '0120H000001O7IWQA0'::text)
Planning time : 65.376 ms
Execution time : 41,941.293 ms