explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Batm

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 419.309 ↓ 20.0 20 1

Limit (cost=21,890.71..21,890.71 rows=1 width=1,476) (actual time=419.306..419.309 rows=20 loops=1)

2.          

CTE rankquery

3. 2.445 413.838 ↓ 3,957.0 3,957 1

WindowAgg (cost=21,890.68..21,890.70 rows=1 width=112) (actual time=413.014..413.838 rows=3,957 loops=1)

4. 8.408 411.393 ↓ 3,957.0 3,957 1

GroupAggregate (cost=21,890.68..21,890.70 rows=1 width=104) (actual time=402.017..411.393 rows=3,957 loops=1)

  • Group Key: acc.name, pro.name, s.source_type__c, ca.origin
5. 54.217 402.985 ↓ 8,000.0 8,000 1

Sort (cost=21,890.68..21,890.69 rows=1 width=81) (actual time=402.004..402.985 rows=8,000 loops=1)

  • Sort Key: acc.name, pro.name, s.source_type__c, ca.origin
  • Sort Method: quicksort Memory: 1289kB
6. 1.096 348.768 ↓ 8,000.0 8,000 1

Nested Loop (cost=1,332.16..21,890.68 rows=1 width=81) (actual time=85.729..348.768 rows=8,000 loops=1)

  • Join Filter: ((ca.accountid)::text = (acc.sfid)::text)
7. 0.000 299.672 ↓ 8,000.0 8,000 1

Gather (cost=1,332.11..21,890.59 rows=1 width=115) (actual time=85.712..299.672 rows=8,000 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
8. 42.538 322.495 ↓ 2,000.0 2,000 4

Nested Loop (cost=332.11..20,890.49 rows=1 width=115) (actual time=74.026..322.495 rows=2,000 loops=4)

9. 36.690 279.937 ↓ 416.6 2,083 4

Nested Loop (cost=332.02..20,870.82 rows=5 width=90) (actual time=73.893..279.937 rows=2,083 loops=4)

10. 188.675 243.230 ↓ 5.6 2,084 4

Parallel Bitmap Heap Scan on "case" ca (cost=331.94..19,583.26 rows=373 width=74) (actual time=73.739..243.230 rows=2,084 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[]) (...)
  • Rows Removed by Filter: 3226
  • Heap Blocks: exact=38593
11. 54.555 54.555 ↓ 23.2 228,834 1

Bitmap Index Scan on hc_idx_case_createddate (cost=0.00..331.88 rows=9,884 width=0) (actual time=54.554..54.555 rows=228,834 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))
12. 0.017 0.017 ↑ 1.0 1 8,334

Index Scan using source__c_idx_sfid on source__c s (cost=0.08..3.45 rows=1 width=54) (actual time=0.017..0.017 rows=1 loops=8,334)

  • 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
13. 0.020 0.020 ↑ 1.0 1 8,331

Index Scan using property__c_idx_sfid on property__c pro (cost=0.08..3.93 rows=1 width=63) (actual time=0.020..0.020 rows=1 loops=8,331)

  • Index Cond: ((sfid)::text = (ca.property_of_interest__c)::text)
  • Filter: ((ca.accountid)::text = (account__c)::text)
14. 48.000 48.000 ↑ 1.0 1 8,000

Index Scan using account_idx_sfid on account acc (cost=0.06..0.09 rows=1 width=42) (actual time=0.006..0.006 rows=1 loops=8,000)

  • Index Cond: ((sfid)::text = (pro.account__c)::text)
15. 1.398 419.305 ↓ 20.0 20 1

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

  • Sort Key: ra.accountname, ra.propertyname, ra.sourcetype, ra.mediatype
  • Sort Method: top-N heapsort Memory: 30kB
16. 2.383 417.907 ↓ 3,957.0 3,957 1

WindowAgg (cost=0.00..0.01 rows=1 width=1,476) (actual time=416.982..417.907 rows=3,957 loops=1)

17. 415.524 415.524 ↓ 3,957.0 3,957 1

CTE Scan on rankquery ra (cost=0.00..0.01 rows=1 width=1,348) (actual time=413.016..415.524 rows=3,957 loops=1)

Planning time : 5.936 ms
Execution time : 423.070 ms