explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YRLh

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 511.715 ↓ 20.0 20 1

Limit (cost=20,997.93..20,997.93 rows=1 width=1,476) (actual time=511.712..511.715 rows=20 loops=1)

2.          

CTE rankquery

3. 5.232 499.405 ↓ 7,974.0 7,974 1

GroupAggregate (cost=20,997.90..20,997.91 rows=1 width=108) (actual time=493.056..499.405 rows=7,974 loops=1)

  • Group Key: acc.name, pro.name, s.source_type__c, ca.id
4. 85.152 494.173 ↓ 7,974.0 7,974 1

Sort (cost=20,997.90..20,997.90 rows=1 width=85) (actual time=493.047..494.173 rows=7,974 loops=1)

  • Sort Key: acc.name, pro.name, s.source_type__c, ca.id
  • Sort Method: quicksort Memory: 1301kB
5. 2.606 409.021 ↓ 7,974.0 7,974 1

Nested Loop (cost=1,317.29..20,997.90 rows=1 width=85) (actual time=85.352..409.021 rows=7,974 loops=1)

  • Join Filter: ((ca.accountid)::text = (acc.sfid)::text)
6. 0.000 326.675 ↓ 7,974.0 7,974 1

Gather (cost=1,317.24..20,997.81 rows=1 width=119) (actual time=85.323..326.675 rows=7,974 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
7. 51.586 376.076 ↓ 1,994.0 1,994 4

Nested Loop (cost=317.24..19,997.71 rows=1 width=119) (actual time=75.368..376.076 rows=1,994 loops=4)

8. 45.729 324.466 ↓ 415.2 2,076 4

Nested Loop (cost=317.15..19,978.01 rows=5 width=94) (actual time=75.207..324.466 rows=2,076 loops=4)

9. 226.955 278.716 ↓ 5.8 2,077 4

Parallel Bitmap Heap Scan on "case" ca (cost=317.07..18,738.58 rows=357 width=78) (actual time=75.053..278.716 rows=2,077 loops=4)

  • Recheck Cond: ((createddate >= '2019-05-13 12:32:16'::timestamp without time zone) AND (createddate < '2019-05-14 12:32:16'::timestamp without time zone))
  • Filter: (ic_call_answered_by_ah__c AND (pulled_from_external_system__c IS NULL) AND ((recordtypeid)::text = '012i0000000DVbcAAG'::text) AND ((status)::text = ANY ('{Inquiry,"Showing Set",Closed}'::text[])) AND (...)
  • Rows Removed by Filter: 3132
  • Heap Blocks: exact=24013
10. 51.761 51.761 ↓ 23.9 226,046 1

Bitmap Index Scan on hc_idx_case_createddate (cost=0.00..317.02 rows=9,452 width=0) (actual time=51.761..51.761 rows=226,046 loops=1)

  • Index Cond: ((createddate >= '2019-05-13 12:32:16'::timestamp without time zone) AND (createddate < '2019-05-14 12:32:16'::timestamp without time zone))
11. 0.021 0.021 ↑ 1.0 1 8,308

Index Scan using source__c_idx_sfid on source__c s (cost=0.08..3.47 rows=1 width=54) (actual time=0.021..0.021 rows=1 loops=8,308)

  • Index Cond: ((sfid)::text = (ca.ad_source2__c)::text)
  • Filter: ((source_type__c IS NOT NULL) AND ((ca.accountid)::text = (account__c)::text))
  • Rows Removed by Filter: 0
12. 0.024 0.024 ↑ 1.0 1 8,305

Index Scan using property__c_idx_sfid on property__c pro (cost=0.08..3.94 rows=1 width=63) (actual time=0.024..0.024 rows=1 loops=8,305)

  • Index Cond: ((sfid)::text = (ca.property_of_interest__c)::text)
  • Filter: ((ca.accountid)::text = (account__c)::text)
13. 79.740 79.740 ↑ 1.0 1 7,974

Index Scan using account_idx_sfid on account acc (cost=0.06..0.09 rows=1 width=42) (actual time=0.010..0.010 rows=1 loops=7,974)

  • Index Cond: ((sfid)::text = (pro.account__c)::text)
14. 2.582 511.712 ↓ 20.0 20 1

Sort (cost=0.01..0.01 rows=1 width=1,476) (actual time=511.711..511.712 rows=20 loops=1)

  • Sort Key: ra.accountname, ra.propertyname, ra.sourcetype, ra.mediatype
  • Sort Method: top-N heapsort Memory: 30kB
15. 6.022 509.130 ↓ 7,974.0 7,974 1

WindowAgg (cost=0.00..0.01 rows=1 width=1,476) (actual time=507.073..509.130 rows=7,974 loops=1)

16. 503.108 503.108 ↓ 7,974.0 7,974 1

CTE Scan on rankquery ra (cost=0.00..0.01 rows=1 width=1,344) (actual time=493.068..503.108 rows=7,974 loops=1)