explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VMKU

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 16.864 937.322 ↓ 86,651.0 86,651 1

Unique (cost=8,575.21..8,575.22 rows=1 width=347) (actual time=887.587..937.322 rows=86,651 loops=1)

2. 153.071 920.458 ↓ 86,651.0 86,651 1

Sort (cost=8,575.21..8,575.21 rows=1 width=347) (actual time=887.587..920.458 rows=86,651 loops=1)

  • Sort Key: e.ema_env_codigo, c.ema_con_codigo DESC
  • Sort Method: external merge Disk: 27880kB
3. 91.165 767.387 ↓ 86,651.0 86,651 1

Nested Loop (cost=2,337.54..8,575.20 rows=1 width=347) (actual time=176.929..767.387 rows=86,651 loops=1)

4. 85.894 261.422 ↓ 196.4 103,700 1

Bitmap Heap Scan on ger_emails_enviados e (cost=2,337.11..4,291.00 rows=528 width=35) (actual time=176.899..261.422 rows=103,700 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=6922
5. 7.764 175.528 ↓ 0.0 0 1

BitmapAnd (cost=2,337.11..2,337.11 rows=528 width=0) (actual time=175.528..175.528 rows=0 loops=1)

6. 139.313 139.313 ↓ 176.2 659,357 1

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

  • Index Cond: (((ema_env_provider)::text = 'bry'::text) AND ((ema_env_response_info ->> 'status'::text) = 'sucesso'::text))
7. 28.451 28.451 ↓ 1.0 125,967 1

Bitmap Index Scan on ger_emails_enviados_ema_env_data_envio_idx (cost=0.00..2,238.75 rows=120,842 width=0) (actual time=28.451..28.451 rows=125,967 loops=1)

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

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

  • Index Cond: (cod_ger_emails_enviados = e.ema_env_codigo)
  • Filter: ((((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.757 ms
Execution time : 952.959 ms