explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L7Jo

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,640.119 ↓ 0.0 0 1

Limit (cost=269,148.55..269,148.56 rows=1 width=502) (actual time=3,640.119..3,640.119 rows=0 loops=1)

  • Output: cte_results.reply_to_email_address, cte_results.id
  • Buffers: shared hit=999414, temp written=18296
2.          

CTE cte_results

3. 1,315.630 1,315.630 ↓ 1.1 1,646,298 1

Index Scan using idx_se_sent_on on public.system_emails (cost=0.58..175,482.63 rows=1,441,014 width=125) (actual time=0.088..1,315.630 rows=1,646,298 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=999411
4. 0.013 3,640.119 ↓ 0.0 0 1

Sort (cost=93,665.92..93,665.93 rows=1 width=502) (actual time=3,640.119..3,640.119 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=999414, temp written=18296
5. 3,640.106 3,640.106 ↓ 0.0 0 1

CTE Scan on cte_results (cost=0.00..93,665.91 rows=1 width=502) (actual time=3,640.106..3,640.106 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 ~~* '%SUBJECT GOES HERE%'::text))
  • Rows Removed by Filter: 1646298
  • Buffers: shared hit=999411, temp written=18296