explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OThq

Settings
# exclusive inclusive rows x rows loops node
1. 0.075 8,141.987 ↓ 1.0 327 1

Unique (cost=112,805.94..112,808.36 rows=322 width=12) (actual time=8,141.886..8,141.987 rows=327 loops=1)

2. 0.641 8,141.912 ↓ 1.0 327 1

Sort (cost=112,805.94..112,806.75 rows=322 width=12) (actual time=8,141.886..8,141.912 rows=327 loops=1)

  • Sort Key: (count(((ger_emails_consulta.ema_con_json -> 'status'::text) ->> 'data_envio'::text))), arq_rem_consumidores.cod_arq_rem_arquivo
  • Sort Method: quicksort Memory: 40kB
3. 362.547 8,141.271 ↓ 1.0 327 1

GroupAggregate (cost=112,746.02..112,792.53 rows=322 width=12) (actual time=7,460.601..8,141.271 rows=327 loops=1)

  • Group Key: arq_rem_consumidores.cod_arq_rem_arquivo
4. 1,419.172 7,778.724 ↓ 175.6 608,133 1

Sort (cost=112,746.02..112,754.68 rows=3,463 width=314) (actual time=7,459.695..7,778.724 rows=608,133 loops=1)

  • Sort Key: arq_rem_consumidores.cod_arq_rem_arquivo
  • Sort Method: external merge Disk: 168504kB
5. 475.113 6,359.552 ↓ 175.6 608,133 1

Nested Loop (cost=0.85..112,542.43 rows=3,463 width=314) (actual time=0.062..6,359.552 rows=608,133 loops=1)

6. 301.723 4,060.040 ↓ 175.6 608,133 1

Nested Loop (cost=0.42..110,210.66 rows=3,463 width=314) (actual time=0.050..4,060.040 rows=608,133 loops=1)

7. 1,325.785 1,325.785 ↓ 153.2 608,133 1

Seq Scan on ger_emails_consulta (cost=0.00..85,536.77 rows=3,969 width=314) (actual time=0.033..1,325.785 rows=608,133 loops=1)

  • Filter: ((ema_con_json -> 'erro'::text) = 'false'::jsonb)
  • Rows Removed by Filter: 185373
8. 2,432.532 2,432.532 ↑ 1.0 1 608,133

Index Scan using ger_emails_enviados_pkey on ger_emails_enviados (cost=0.42..6.21 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=608,133)

  • Index Cond: (ema_env_codigo = ger_emails_consulta.cod_ger_emails_enviados)
  • Filter: ((ema_env_provider)::text = 'bry'::text)
9. 1,824.399 1,824.399 ↑ 1.0 1 608,133

Index Scan using arq_rem_consumidores_pkey on arq_rem_consumidores (cost=0.42..0.66 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=608,133)

  • Index Cond: (rem_com_codigo = ger_emails_enviados.cod_arq_rem_consumidores)
Planning time : 1.038 ms
Execution time : 8,186.981 ms