explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LoGh : Optimization for: plan #VMKU

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 17.783 871.632 ↓ 86,651.0 86,651 1

Unique (cost=8,575.18..8,575.19 rows=1 width=347) (actual time=818.844..871.632 rows=86,651 loops=1)

2. 142.019 853.849 ↓ 86,651.0 86,651 1

Sort (cost=8,575.18..8,575.18 rows=1 width=347) (actual time=818.843..853.849 rows=86,651 loops=1)

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

Nested Loop (cost=2,337.51..8,575.17 rows=1 width=347) (actual time=167.362..711.830 rows=86,651 loops=1)

4. 78.600 244.575 ↓ 196.4 103,700 1

Bitmap Heap Scan on ger_emails_enviados e (cost=2,337.08..4,290.97 rows=528 width=35) (actual time=167.334..244.575 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.761 165.975 ↓ 0.0 0 1

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

6. 138.260 138.260 ↓ 176.2 659,357 1

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

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

Bitmap Index Scan on ger_emails_enviados_ema_env_data_envio_idx (cost=0.00..2,238.72 rows=120,838 width=0) (actual time=19.954..19.954 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.541 ms
Execution time : 887.967 ms