explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eVOj

Settings
# exclusive inclusive rows x rows loops node
1. 16.549 866.767 ↓ 86,681.0 86,681 1

Unique (cost=8,652.97..8,652.98 rows=1 width=347) (actual time=817.234..866.767 rows=86,681 loops=1)

2. 143.115 850.218 ↓ 86,681.0 86,681 1

Sort (cost=8,652.97..8,652.98 rows=1 width=347) (actual time=817.233..850.218 rows=86,681 loops=1)

  • Sort Key: env.ema_env_codigo, cons.ema_con_codigo DESC
  • Sort Method: external merge Disk: 27888kB
3. 40.966 707.103 ↓ 86,681.0 86,681 1

Nested Loop (cost=2,357.87..8,652.96 rows=1 width=347) (actual time=177.417..707.103 rows=86,681 loops=1)

4. 75.258 251.201 ↓ 194.6 103,734 1

Bitmap Heap Scan on ger_emails_enviados env (cost=2,357.44..4,329.12 rows=533 width=35) (actual time=177.387..251.201 rows=103,734 loops=1)

  • Recheck Cond: (((ema_env_provider)::text = 'bry'::text) AND ((ema_env_response_info ->> 'status'::text) = 'sucesso'::text) AND (ema_env_data_envio >= (now() - '100 days'::interval)))
  • Heap Blocks: exact=6923
5. 7.287 175.943 ↓ 0.0 0 1

BitmapAnd (cost=2,357.44..2,357.44 rows=533 width=0) (actual time=175.943..175.943 rows=0 loops=1)

6. 148.932 148.932 ↓ 176.2 659,357 1

Bitmap Index Scan on teste_index (cost=0.00..97.86 rows=3,743 width=0) (actual time=148.932..148.932 rows=659,357 loops=1)

  • Index Cond: (((ema_env_provider)::text = 'bry'::text) AND ((ema_env_response_info ->> 'status'::text) = 'sucesso'::text))
7. 19.724 19.724 ↓ 1.0 126,002 1

Bitmap Index Scan on ger_emails_enviados_ema_env_data_envio_idx (cost=0.00..2,259.07 rows=121,952 width=0) (actual time=19.724..19.724 rows=126,002 loops=1)

  • Index Cond: (ema_env_data_envio >= (now() - '100 days'::interval))
8. 414.936 414.936 ↑ 1.0 1 103,734

Index Scan using ger_emails_consulta_cod_ger_emails_enviados_idx on ger_emails_consulta cons (cost=0.42..8.10 rows=1 width=312) (actual time=0.004..0.004 rows=1 loops=103,734)

  • Index Cond: (cod_ger_emails_enviados = env.ema_env_codigo)
  • Filter: ((ema_con_quantidade = 1) AND (((ema_con_json -> 'status'::text) ->> 'data_leitura'::text) IS NULL) AND ((ema_con_json ->> 'erro'::text) = 'false'::text))
  • Rows Removed by Filter: 0
Planning time : 0.531 ms
Execution time : 882.416 ms