explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xGaa

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 745.045 ↑ 1.0 1 1

Unique (cost=700,349.37..700,349.37 rows=1 width=826) (actual time=745.044..745.045 rows=1 loops=1)

2. 0.017 745.044 ↑ 1.0 1 1

Sort (cost=700,349.37..700,349.37 rows=1 width=826) (actual time=745.044..745.044 rows=1 loops=1)

  • Sort Key: e.ema_env_codigo, con.ema_con_codigo
  • Sort Method: quicksort Memory: 25kB
3. 0.043 745.027 ↑ 1.0 1 1

Nested Loop Left Join (cost=60,888.08..700,349.36 rows=1 width=826) (actual time=394.278..745.027 rows=1 loops=1)

  • Join Filter: ("*SELECT* 1".rem_com_codigo = c.rem_com_codigo)
4. 0.002 744.974 ↑ 1.0 1 1

Nested Loop (cost=60,887.38..121,765.08 rows=1 width=2,366) (actual time=394.226..744.974 rows=1 loops=1)

5. 0.004 744.968 ↑ 1.0 1 1

Nested Loop (cost=60,887.11..121,764.78 rows=1 width=2,345) (actual time=394.222..744.968 rows=1 loops=1)

6. 0.002 744.961 ↑ 1.0 1 1

Nested Loop (cost=60,886.68..121,764.13 rows=1 width=2,321) (actual time=394.216..744.961 rows=1 loops=1)

7. 0.001 744.953 ↑ 1.0 1 1

Nested Loop (cost=60,886.26..121,763.25 rows=1 width=2,005) (actual time=394.208..744.953 rows=1 loops=1)

8. 0.007 744.943 ↑ 1.0 1 1

Nested Loop (cost=60,885.98..121,762.95 rows=1 width=2,009) (actual time=394.199..744.943 rows=1 loops=1)

9. 79.727 744.925 ↑ 1.0 1 1

Hash Right Join (cost=60,885.56..121,762.29 rows=1 width=2,001) (actual time=394.182..744.925 rows=1 loops=1)

  • Hash Cond: (ger_emails_enviados.cod_arq_rem_consumidores = consumidores.rem_com_codigo)
10. 271.116 271.116 ↑ 1.0 855,980 1

Seq Scan on ger_emails_enviados (cost=0.00..57,666.80 rows=855,980 width=4) (actual time=0.008..271.116 rows=855,980 loops=1)

11. 0.005 394.082 ↑ 1.0 1 1

Hash (cost=60,885.55..60,885.55 rows=1 width=2,001) (actual time=394.082..394.082 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.006 394.077 ↑ 1.0 1 1

Nested Loop (cost=8.58..60,885.55 rows=1 width=2,001) (actual time=0.233..394.077 rows=1 loops=1)

  • Join Filter: (gse.cod_arq_rem_consumidores = consumidores.rem_com_codigo)
13. 78.469 394.059 ↑ 1.0 1 1

Hash Join (cost=8.15..60,884.89 rows=1 width=1,681) (actual time=0.217..394.059 rows=1 loops=1)

  • Hash Cond: (e.cod_arq_rem_consumidores = gse.cod_arq_rem_consumidores)
14. 315.575 315.575 ↑ 1.0 855,980 1

Seq Scan on ger_emails_enviados e (cost=0.00..57,666.80 rows=855,980 width=249) (actual time=0.015..315.575 rows=855,980 loops=1)

15. 0.005 0.015 ↑ 1.0 1 1

Hash (cost=8.14..8.14 rows=1 width=1,432) (actual time=0.015..0.015 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
16. 0.010 0.010 ↑ 1.0 1 1

Index Scan using ger_sms_enviados_cod_arq_rem_consumidores_idx on ger_sms_enviados gse (cost=0.12..8.14 rows=1 width=1,432) (actual time=0.009..0.010 rows=1 loops=1)

  • Filter: ((cod_arq_ret_arquivo_leitura IS NULL) AND (sms_env_pagina_track IS NOT NULL))
17. 0.012 0.012 ↑ 1.0 1 1

Index Scan using arq_rem_consumidores_pkey on arq_rem_consumidores consumidores (cost=0.42..0.65 rows=1 width=320) (actual time=0.011..0.012 rows=1 loops=1)

  • Index Cond: (rem_com_codigo = e.cod_arq_rem_consumidores)
18. 0.011 0.011 ↑ 1.0 1 1

Index Scan using arq_rem_consumidores_pkey on arq_rem_consumidores c_1 (cost=0.42..0.64 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (rem_com_codigo = consumidores.rem_com_codigo)
19. 0.009 0.009 ↑ 1.0 1 1

Index Scan using arq_rem_arquivo_pkey on arq_rem_arquivo a_1 (cost=0.27..0.29 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (rem_arq_codigo = c_1.cod_arq_rem_arquivo)
  • Filter: (rem_arq_status = 'EN'::bpchar)
20. 0.006 0.006 ↑ 1.0 1 1

Index Scan using ger_emails_consulta_cod_ger_emails_enviados_idx on ger_emails_consulta con (cost=0.42..0.87 rows=1 width=316) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (cod_ger_emails_enviados = e.ema_env_codigo)
21. 0.003 0.003 ↑ 1.0 1 1

Index Scan using arq_rem_consumidores_pkey on arq_rem_consumidores c (cost=0.42..0.64 rows=1 width=40) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (rem_com_codigo = consumidores.rem_com_codigo)
22. 0.004 0.004 ↑ 1.0 1 1

Index Scan using arq_rem_arquivo_pkey on arq_rem_arquivo a (cost=0.27..0.29 rows=1 width=25) (actual time=0.002..0.004 rows=1 loops=1)

  • Index Cond: (rem_arq_codigo = c.cod_arq_rem_arquivo)
23. 0.000 0.010 ↓ 0.0 0 1

Append (cost=0.70..573,935.03 rows=371,932 width=36) (actual time=0.010..0.010 rows=0 loops=1)

24. 0.000 0.007 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=0.70..286,967.52 rows=185,966 width=36) (actual time=0.007..0.007 rows=0 loops=1)

25. 0.002 0.007 ↓ 0.0 0 1

Nested Loop (cost=0.70..285,107.86 rows=185,966 width=40) (actual time=0.007..0.007 rows=0 loops=1)

26. 0.000 0.005 ↓ 0.0 0 1

Subquery Scan on enrichment_empresa (cost=0.70..3,834.28 rows=185,966 width=36) (actual time=0.005..0.005 rows=0 loops=1)

  • Filter: (enrichment_empresa.contato IS NOT NULL)
27. 0.000 0.005 ↓ 0.0 0 1

Nested Loop (cost=0.70..1,965.28 rows=186,900 width=40) (actual time=0.005..0.005 rows=0 loops=1)

28. 0.006 0.006 ↓ 0.0 0 1

Index Scan using arq_rem_arquivo_rem_arq_status_idx on arq_rem_arquivo arq (cost=0.27..8.29 rows=1 width=4) (actual time=0.005..0.006 rows=0 loops=1)

  • Index Cond: (rem_arq_status = 'PR'::bpchar)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using arq_rem_consumidores_cod_arq_rem_arquivo_idx on arq_rem_consumidores arc (cost=0.42..990.74 rows=2,240 width=40) (never executed)

  • Index Cond: (cod_arq_rem_arquivo = arq.rem_arq_codigo)
30. 0.000 0.000 ↓ 0.0 0

Function Scan on jsonb_array_elements emails (cost=0.01..1.50 rows=1 width=32) (never executed)

  • Filter: ((value ->> 'ordem'::text) = '1'::text)
31. 0.000 0.003 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.70..286,967.52 rows=185,966 width=36) (actual time=0.003..0.003 rows=0 loops=1)

32. 0.000 0.003 ↓ 0.0 0 1

Nested Loop (cost=0.70..285,107.86 rows=185,966 width=40) (actual time=0.003..0.003 rows=0 loops=1)

33. 0.001 0.003 ↓ 0.0 0 1

Subquery Scan on enrichment_pessoa (cost=0.70..3,834.28 rows=185,966 width=36) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: (enrichment_pessoa.contato IS NOT NULL)
34. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.70..1,965.28 rows=186,900 width=40) (actual time=0.002..0.002 rows=0 loops=1)

35. 0.002 0.002 ↓ 0.0 0 1

Index Scan using arq_rem_arquivo_rem_arq_status_idx on arq_rem_arquivo arq_1 (cost=0.27..8.29 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (rem_arq_status = 'PR'::bpchar)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using arq_rem_consumidores_cod_arq_rem_arquivo_idx on arq_rem_consumidores arc_1 (cost=0.42..990.74 rows=2,240 width=40) (never executed)

  • Index Cond: (cod_arq_rem_arquivo = arq_1.rem_arq_codigo)
37. 0.000 0.000 ↓ 0.0 0

Function Scan on jsonb_array_elements emails_1 (cost=0.01..1.50 rows=1 width=32) (never executed)

  • Filter: ((value ->> 'ordem'::text) = '1'::text)
Planning time : 10.401 ms
Execution time : 745.372 ms