explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rDej

Settings
# exclusive inclusive rows x rows loops node
1. 54.798 4,098.212 ↓ 70,800.0 70,800 1

Subquery Scan on main (cost=35,901.76..35,914.00 rows=1 width=339) (actual time=3,975.570..4,098.212 rows=70,800 loops=1)

  • Filter: ((main.ema_con_quantidade = 1) AND (((main.ema_con_json -> 'status'::text) ->> 'data_leitura'::text) IS NULL))
  • Rows Removed by Filter: 26913
2. 23.393 4,043.414 ↓ 179.6 97,713 1

Unique (cost=35,901.76..35,904.48 rows=544 width=347) (actual time=3,975.557..4,043.414 rows=97,713 loops=1)

3. 189.799 4,020.021 ↓ 212.1 115,386 1

Sort (cost=35,901.76..35,903.12 rows=544 width=347) (actual time=3,975.555..4,020.021 rows=115,386 loops=1)

  • Sort Key: cons.cod_ger_emails_enviados, cons.ema_con_codigo DESC
  • Sort Method: external merge Disk: 37840kB
4. 257.003 3,830.222 ↓ 212.1 115,386 1

Nested Loop (cost=0.85..35,877.04 rows=544 width=347) (actual time=14.631..3,830.222 rows=115,386 loops=1)

5. 549.335 549.335 ↓ 173.1 755,971 1

Index Scan using teste_consulta_index on ger_emails_consulta cons (cost=0.42..8,057.30 rows=4,367 width=312) (actual time=0.041..549.335 rows=755,971 loops=1)

  • Index Cond: ((cod_ger_fornecedores_email = 2) AND ((ema_con_json ->> 'erro'::text) = 'false'::text))
6. 3,023.884 3,023.884 ↓ 0.0 0 755,971

Index Scan using ger_emails_enviados_pkey on ger_emails_enviados env (cost=0.42..6.36 rows=1 width=35) (actual time=0.004..0.004 rows=0 loops=755,971)

  • Index Cond: (ema_env_codigo = cons.cod_ger_emails_enviados)
  • Filter: (((ema_env_provider)::text = 'bry'::text) AND (ema_env_data_envio >= (now() - '100 days'::interval)))
  • Rows Removed by Filter: 1
Planning time : 0.694 ms
Execution time : 4,109.175 ms