explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fUum

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 1.115 ↓ 9.0 18 1

Sort (cost=1,062.61..1,062.61 rows=2 width=111) (actual time=1.114..1.115 rows=18 loops=1)

  • Sort Key: "*SELECT* 1".updatedat DESC
  • Sort Method: quicksort Memory: 27kB
2. 0.002 1.098 ↓ 9.0 18 1

Append (cost=399.01..1,062.60 rows=2 width=111) (actual time=0.456..1.098 rows=18 loops=1)

3. 0.003 0.811 ↓ 18.0 18 1

Subquery Scan on *SELECT* 1 (cost=399.01..529.85 rows=1 width=111) (actual time=0.455..0.811 rows=18 loops=1)

4. 0.034 0.808 ↓ 18.0 18 1

Nested Loop Semi Join (cost=399.01..529.84 rows=1 width=635) (actual time=0.454..0.808 rows=18 loops=1)

5. 0.074 0.494 ↓ 28.0 28 1

Bitmap Heap Scan on templates (cost=398.32..521.81 rows=1 width=137) (actual time=0.432..0.494 rows=28 loops=1)

  • Recheck Cond: ((tenant_key)::text = '84838985cdf436a7ff1a054b03d8d8dd26d2f1c37da0201af239e154f827aef6'::text)
  • Filter: (((template_type)::text = ANY ('{Email,Survey}'::text[])) AND (replace((template_type)::text, ' '::text, ''::text) = ANY ('{Email,Survey}'::text[])))
  • Rows Removed by Filter: 9
  • Heap Blocks: exact=35
6. 0.420 0.420 ↓ 1.1 40 1

Bitmap Index Scan on pk_templates (cost=0.00..398.32 rows=37 width=0) (actual time=0.420..0.420 rows=40 loops=1)

  • Index Cond: ((tenant_key)::text = '84838985cdf436a7ff1a054b03d8d8dd26d2f1c37da0201af239e154f827aef6'::text)
7. 0.280 0.280 ↑ 49.0 1 28

Index Scan using ix_email_events_tenant_key_template_id_event on email_events (cost=0.69..231.09 rows=49 width=67) (actual time=0.010..0.010 rows=1 loops=28)

  • Index Cond: (((tenant_key)::text = '84838985cdf436a7ff1a054b03d8d8dd26d2f1c37da0201af239e154f827aef6'::text) AND ((template_id)::text = (templates.template_id)::text) AND ((event)::text = 'processed'::text))
  • Filter: (created_at > '2018-01-01 00:00:00'::timestamp without time zone)
8. 0.000 0.285 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=398.88..532.75 rows=1 width=111) (actual time=0.285..0.285 rows=0 loops=1)

9. 0.000 0.285 ↓ 0.0 0 1

Nested Loop Semi Join (cost=398.88..532.74 rows=1 width=635) (actual time=0.285..0.285 rows=0 loops=1)

10. 0.032 0.285 ↓ 0.0 0 1

Bitmap Heap Scan on templates templates_1 (cost=398.32..521.81 rows=1 width=137) (actual time=0.285..0.285 rows=0 loops=1)

  • Recheck Cond: ((tenant_key)::text = '84838985cdf436a7ff1a054b03d8d8dd26d2f1c37da0201af239e154f827aef6'::text)
  • Filter: (((template_type)::text <> ALL ('{Email,Survey}'::text[])) AND (replace((template_type)::text, ' '::text, ''::text) = ANY ('{Email,Survey}'::text[])))
  • Rows Removed by Filter: 37
  • Heap Blocks: exact=35
11. 0.253 0.253 ↓ 1.1 40 1

Bitmap Index Scan on pk_templates (cost=0.00..398.32 rows=37 width=0) (actual time=0.253..0.253 rows=40 loops=1)

  • Index Cond: ((tenant_key)::text = '84838985cdf436a7ff1a054b03d8d8dd26d2f1c37da0201af239e154f827aef6'::text)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using ix_communications_tenant_key_template_id on communications (cost=0.56..131.89 rows=17 width=68) (never executed)

  • Index Cond: (((tenant_key)::text = '84838985cdf436a7ff1a054b03d8d8dd26d2f1c37da0201af239e154f827aef6'::text) AND ((template_id)::text = (templates_1.template_id)::text))
  • Filter: ((NOT testing_mode) AND (local_created_at > '2018-01-01 00:00:00'::timestamp without time zone) AND ((status)::text = 'Processed'::text))
Planning time : 1.385 ms
Execution time : 1.184 ms