explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1s4g

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 4,144.447 ↓ 0.0 0 1

Limit (cost=268,997.00..268,997.00 rows=1 width=502) (actual time=4,144.447..4,144.447 rows=0 loops=1)

  • Output: cte_results.reply_to_email_address, cte_results.id
  • Buffers: shared hit=999298, temp written=18291
2.          

CTE cte_results

3. 1,297.642 1,297.642 ↓ 1.1 1,645,889 1

Index Scan using idx_se_sent_on on public.system_emails (cost=0.58..175,384.51 rows=1,440,192 width=125) (actual time=0.091..1,297.642 rows=1,645,889 loops=1)

  • Output: system_emails.id, system_emails.reply_to_email_address, system_emails.to_email_address, system_emails.subject
  • Index Cond: (system_emails.sent_on > (now() - '3 days'::interval))
  • Buffers: shared hit=999295
4. 0.013 4,144.446 ↓ 0.0 0 1

Sort (cost=93,612.49..93,612.49 rows=1 width=502) (actual time=4,144.446..4,144.446 rows=0 loops=1)

  • Output: cte_results.reply_to_email_address, cte_results.id
  • Sort Key: cte_results.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=999298, temp written=18291
5. 4,144.433 4,144.433 ↓ 0.0 0 1

CTE Scan on cte_results (cost=0.00..93,612.48 rows=1 width=502) (actual time=4,144.433..4,144.433 rows=0 loops=1)

  • Output: cte_results.reply_to_email_address, cte_results.id
  • Filter: ((cte_results.to_email_address ~~* 'system@entrata.com'::text) AND ((cte_results.subject)::text ~~* '%Your delivery was picked up!%'::text))
  • Rows Removed by Filter: 1645889
  • Buffers: shared hit=999295, temp written=18291