explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gO48

Settings
# exclusive inclusive rows x rows loops node
1. 0.067 13,954.803 ↓ 1.0 327 1

Unique (cost=134,554.89..134,557.30 rows=322 width=12) (actual time=13,954.618..13,954.803 rows=327 loops=1)

2. 0.805 13,954.736 ↓ 1.0 327 1

Sort (cost=134,554.89..134,555.69 rows=322 width=12) (actual time=13,954.614..13,954.736 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. 320.861 13,953.931 ↓ 1.0 327 1

GroupAggregate (cost=134,499.86..134,541.47 rows=322 width=12) (actual time=13,339.475..13,953.931 rows=327 loops=1)

  • Group Key: arq_rem_consumidores.cod_arq_rem_arquivo
4. 1,431.832 13,633.070 ↓ 173.1 531,463 1

Sort (cost=134,499.86..134,507.54 rows=3,071 width=314) (actual time=13,338.573..13,633.070 rows=531,463 loops=1)

  • Sort Key: arq_rem_consumidores.cod_arq_rem_arquivo
  • Sort Method: external merge Disk: 147624kB
5. 443.843 12,201.238 ↓ 173.1 531,463 1

Nested Loop (cost=21,702.05..134,321.99 rows=3,071 width=314) (actual time=276.735..12,201.238 rows=531,463 loops=1)

6. 299.211 8,037.154 ↓ 173.1 531,463 1

Nested Loop (cost=21,701.62..132,254.16 rows=3,071 width=314) (actual time=276.710..8,037.154 rows=531,463 loops=1)

7. 1,324.704 3,486.239 ↓ 151.0 531,463 1

Hash Semi Join (cost=21,701.20..110,371.55 rows=3,520 width=314) (actual time=276.661..3,486.239 rows=531,463 loops=1)

  • Hash Cond: (ger_emails_consulta.ema_con_codigo = emails_consulta_unique.ema_con_codigo)
8. 1,885.624 1,885.624 ↓ 153.2 608,133 1

Seq Scan on ger_emails_consulta (cost=0.00..85,536.77 rows=3,969 width=318) (actual time=0.025..1,885.624 rows=608,133 loops=1)

  • Filter: ((ema_con_json -> 'erro'::text) = 'false'::jsonb)
  • Rows Removed by Filter: 185373
9. 172.358 275.911 ↑ 1.0 703,831 1

Hash (cost=10,153.31..10,153.31 rows=703,831 width=4) (actual time=275.911..275.911 rows=703,831 loops=1)

  • Buckets: 131072 Batches: 16 Memory Usage: 2571kB
10. 103.553 103.553 ↑ 1.0 703,831 1

Seq Scan on emails_consulta_unique (cost=0.00..10,153.31 rows=703,831 width=4) (actual time=0.019..103.553 rows=703,831 loops=1)

11. 4,251.704 4,251.704 ↑ 1.0 1 531,463

Index Scan using ger_emails_enviados_pkey on ger_emails_enviados (cost=0.42..6.21 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=531,463)

  • Index Cond: (ema_env_codigo = ger_emails_consulta.cod_ger_emails_enviados)
  • Filter: ((ema_env_provider)::text = 'bry'::text)
12. 3,720.241 3,720.241 ↑ 1.0 1 531,463

Index Scan using arq_rem_consumidores_pkey on arq_rem_consumidores (cost=0.42..0.66 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=531,463)

  • Index Cond: (rem_com_codigo = ger_emails_enviados.cod_arq_rem_consumidores)
Planning time : 1.087 ms
Execution time : 13,996.257 ms