explain.depesz.com

A tool for finding a real cause for slow queries.

Result: dEGn

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Append (cost=1,379.71..11,542.38 rows=131 width=253) (actual time=.. rows= loops=)

2.          

CTE afiliados

3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,343.55..1,379.71 rows=129 width=184) (actual time=.. rows= loops=)

  • Hash Cond: (((dados.prefdep)::bpchar = (mob.es_prefixo)::bpchar) AND (dados.es_cnpj = mob.es_cpf_cnpj))
4.          

CTE dados

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.00..241.67 rows=130 width=86) (actual time=.. rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Scan using tbldependenciasbr_pkey on tbldependenciasbr d (cost=0.00..8.28 rows=1 width=5) (actual time=.. rows= loops=)

  • Index Cond: ((prefdep)::text = '2890'::text)
7. 0.000 0.000 ↓ 0.0

Index Scan using afiliacao_cielo_mob_diretor_publico_alvo_pkey on afiliacao_cielo_mob_diretor_publico_alvo alvo (cost=0.00..231.77 rows=130 width=86) (actual time=.. rows= loops=)

  • Index Cond: ((d.prefdep)::bpchar = (alvo.es_prefixo)::bpchar)
8. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24.68..31.16 rows=129 width=169) (actual time=.. rows= loops=)

  • Hash Cond: (((dados.prefdep)::bpchar = (entra_sai.es_prefixo)::bpchar) AND (dados.es_cnpj = entra_sai.es_cpf_cnpj))
9. 0.000 0.000 ↓ 0.0

CTE Scan on dados (cost=0.00..2.60 rows=129 width=152) (actual time=.. rows= loops=)

  • Filter: (es_razao_social IS NOT NULL)
10. 0.000 0.000 ↓ 0.0

Hash (cost=15.87..15.87 rows=587 width=40) (actual time=.. rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on afiliacao_cielo_diretor_ent_sai entra_sai (cost=0.00..15.87 rows=587 width=40) (actual time=.. rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash (cost=668.48..668.48 rows=27,248 width=35) (actual time=.. rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on afiliacao_cielo_mob_diretor mob (cost=0.00..668.48 rows=27,248 width=35) (actual time=.. rows= loops=)

14. 0.000 0.000 ↓ 0.0

Subquery Scan on "*SELECT* 1" (cost=0.00..3.87 rows=129 width=256) (actual time=.. rows= loops=)

15. 0.000 0.000 ↓ 0.0

CTE Scan on afiliados (cost=0.00..2.58 rows=129 width=256) (actual time=.. rows= loops=)

16. 0.000 0.000 ↓ 0.0

Subquery Scan on "*SELECT* 2" (cost=6,860.73..7,682.26 rows=1 width=76) (actual time=.. rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=6,860.73..7,682.25 rows=1 width=76) (actual time=.. rows= loops=)

  • Hash Cond: (afiliacao_cielo_mob_diretor.es_cpf_cnpj = esporadicos.afiliacao_cielo_mob_diretor_publico_alvo.es_cnpj)
18.          

Initplan (forHash Anti Join)

19. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.02 rows=1 width=20) (actual time=.. rows= loops=)

20. 0.000 0.000 ↓ 0.0

CTE Scan on afiliados (cost=0.00..2.58 rows=129 width=20) (actual time=.. rows= loops=)

21. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.00..25.46 rows=6 width=76) (actual time=.. rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using tbldependenciasbr_pkey on tbldependenciasbr d (cost=0.00..8.28 rows=1 width=5) (actual time=.. rows= loops=)

  • Index Cond: ((prefdep)::text = ($3)::text)
23. 0.000 0.000 ↓ 0.0

Index Scan using afiliacao_cielo_mob_diretor_pkey on afiliacao_cielo_mob_diretor (cost=0.00..17.11 rows=6 width=76) (actual time=.. rows= loops=)

  • Index Cond: ((afiliacao_cielo_mob_diretor.es_prefixo)::bpchar = (d.prefdep)::bpchar)
24. 0.000 0.000 ↓ 0.0

Hash (cost=4,035.76..4,035.76 rows=162,476 width=15) (actual time=.. rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on afiliacao_cielo_mob_diretor_publico_alvo (cost=0.00..4,035.76 rows=162,476 width=15) (actual time=.. rows= loops=)

26. 0.000 0.000 ↓ 0.0

Subquery Scan on "*SELECT* 3" (cost=0.02..2,476.54 rows=1 width=81) (actual time=.. rows= loops=)

27. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=0.02..2,476.53 rows=1 width=81) (actual time=.. rows= loops=)

28.          

Initplan (forNested Loop Anti Join)

29. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.02 rows=1 width=20) (actual time=.. rows= loops=)

30. 0.000 0.000 ↓ 0.0

CTE Scan on afiliados (cost=0.00..2.58 rows=129 width=20) (actual time=.. rows= loops=)

31. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..20.59 rows=2 width=81) (actual time=.. rows= loops=)

32. 0.000 0.000 ↓ 0.0

Index Scan using tbldependenciasbr_pkey on tbldependenciasbr d (cost=0.00..8.28 rows=1 width=5) (actual time=.. rows= loops=)

  • Index Cond: ((prefdep)::text = ($2)::text)
33. 0.000 0.000 ↓ 0.0

Index Scan using afiliacao_cielo_diretor_ent_sai_es_prefixo_es_tipo_idx on afiliacao_cielo_diretor_ent_sai (cost=0.00..12.29 rows=2 width=81) (actual time=.. rows= loops=)

  • Index Cond: (((afiliacao_cielo_diretor_ent_sai.es_prefixo)::bpchar = (d.prefdep)::bpchar) AND (afiliacao_cielo_diretor_ent_sai.es_status IS NOT NULL))
34. 0.000 0.000 ↓ 0.0

Index Scan using afiliacao_cielo_mob_diretor_publico_alvo_pkey on afiliacao_cielo_mob_diretor_publico_alvo (cost=0.00..1,227.95 rows=1 width=15) (actual time=.. rows= loops=)

  • Index Cond: (afiliacao_cielo_diretor_ent_sai.es_cpf_cnpj = esporadicos.afiliacao_cielo_mob_diretor_publico_alvo.es_cnpj)