explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7nY

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 29,329.537 ↑ 1.0 20 1

Limit (cost=2,291.85..2,291.86 rows=20 width=521) (actual time=29,329.526..29,329.537 rows=20 loops=1)

2. 170.779 29,329.526 ↑ 2.5 20 1

Sort (cost=2,291.85..2,291.87 rows=50 width=521) (actual time=29,329.525..29,329.526 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,126.508 29,158.747 ↓ 5,629.9 281,495 1

WindowAgg (cost=0.89..2,291.58 rows=50 width=521) (actual time=28,551.420..29,158.747 rows=281,495 loops=1)

4. 929.238 28,032.239 ↓ 5,629.9 281,495 1

Nested Loop Left Join (cost=0.89..2,291.21 rows=50 width=321) (actual time=1.287..28,032.239 rows=281,495 loops=1)

  • Join Filter: ((ip.team__c)::text = (ipp1.team__c)::text)
  • Rows Removed by Join Filter: 6476042
5. 482.332 26,540.011 ↓ 10,826.7 281,495 1

Nested Loop Left Join (cost=0.73..2,167.66 rows=26 width=319) (actual time=1.010..26,540.011 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. 299.567 24,628.549 ↓ 6,647.1 285,826 1

Nested Loop Left Join (cost=0.62..2,076.12 rows=43 width=262) (actual time=0.220..24,628.549 rows=285,826 loops=1)

7. 370.823 17,469.158 ↓ 6,647.1 285,826 1

Nested Loop Left Join (cost=0.53..2,017.53 rows=43 width=256) (actual time=0.176..17,469.158 rows=285,826 loops=1)

8. 299.030 13,382.597 ↓ 6,647.1 285,826 1

Nested Loop Left Join (cost=0.48..2,014.05 rows=43 width=252) (actual time=0.134..13,382.597 rows=285,826 loops=1)

9. 321.162 2,508.005 ↓ 6,647.1 285,826 1

Nested Loop Left Join (cost=0.36..1,872.03 rows=43 width=185) (actual time=0.129..2,508.005 rows=285,826 loops=1)

  • Filter: (((ipq.employment_status__c)::text = 'Active'::text) OR ((ipq.employment_status__c)::text = ''::text) OR (ipq.employment_status__c IS NULL))
  • Rows Removed by Filter: 50
10. 326.052 2,186.843 ↓ 3,009.2 285,876 1

Nested Loop Left Join (cost=0.31..1,862.11 rows=95 width=204) (actual time=0.121..2,186.843 rows=285,876 loops=1)

11. 96.263 1,860.791 ↓ 3,009.2 285,876 1

Nested Loop (cost=0.20..1,584.49 rows=95 width=178) (actual time=0.116..1,860.791 rows=285,876 loops=1)

12. 1.046 21.894 ↓ 347.0 347 1

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

13. 3.100 3.100 ↑ 1.0 348 1

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

  • Filter: ((employment_status__c)::text = 'Active'::text)
  • Rows Removed by Filter: 411
14. 17.748 17.748 ↑ 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.051..0.051 rows=1 loops=348)

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

Index Scan using hc_idx_qa_form__c_property_consultant__c on qa_form__c qa (cost=0.08..15.43 rows=561 width=169) (actual time=0.091..5.022 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. 10,575.562 10,575.562 ↑ 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.037..0.037 rows=1 loops=285,826)

  • Index Cond: ((qa.case__c)::text = (sfid)::text)
19. 3,715.738 3,715.738 ↑ 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.013..0.013 rows=1 loops=285,826)

  • Index Cond: ((qa.case_account__c)::text = (sfid)::text)
20. 6,859.824 6,859.824 ↑ 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.024..0.024 rows=1 loops=285,826)

  • Index Cond: ((qa.case_property__c)::text = (sfid)::text)
21. 1,429.130 1,429.130 ↓ 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.005..0.005 rows=0 loops=285,826)

  • Index Cond: ((qa.service_request_pop__c)::text = (sfid)::text)
22. 562.177 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.020 0.813 ↑ 1.0 24 1

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

24. 0.289 0.289 ↑ 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.120..0.289 rows=24 loops=1)

  • Index Cond: ((user_profile__c)::text = 'Supervisor'::text)
25. 0.504 0.504 ↑ 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.021..0.021 rows=1 loops=24)

  • Index Cond: ((ipp1.contact__c)::text = (sfid)::text)
  • Filter: ((recordtypeid)::text = '0120H000001O7IWQA0'::text)
Planning time : 23.109 ms
Execution time : 29,334.914 ms