explain.depesz.com

A tool for finding a real cause for slow queries.

Result: i2O

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

HashAggregate (cost=11553.76..11555.07 rows=131 width=274) (actual time=171.788..172.135 rows=560 loops=1)

2.          

CTE desembolso

3. 0.153 168.130 ↓ 4.3 560 1

Append (cost=1379.71..11542.38 rows=131 width=253) (actual time=25.951..168.130 rows=560 loops=1)

4.          

CTE afiliados

5. 1.483 29.521 ↓ 4.2 536 1

Hash Left Join (cost=1343.55..1379.71 rows=129 width=184) (actual time=25.943..29.521 rows=536 loops=1)

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

CTE dados

7. 0.302 0.992 ↓ 4.1 536 1

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

8. 0.027 0.027 ↑ 1.0 1 1

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

  • Index Cond: ((prefdep)::text = '2890'::text)
9. 0.663 0.663 ↓ 4.1 536 1

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=0.029..0.663 rows=536 loops=1)

  • Index Cond: ((d.prefdep)::bpchar = (alvo.es_prefixo)::bpchar)
10. 0.415 2.776 ↓ 4.2 536 1

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

  • Hash Cond: (((dados.prefdep)::bpchar = (entra_sai.es_prefixo)::bpchar) AND (dados.es_cnpj = entra_sai.es_cpf_cnpj))
11. 1.820 1.820 ↓ 4.2 536 1

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

  • Filter: (es_razao_social IS NOT NULL)
12. 0.331 0.541 ↑ 1.0 587 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
13. 0.210 0.210 ↑ 1.0 587 1

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

14. 16.243 25.262 ↑ 1.0 27248 1

Hash (cost=668.48..668.48 rows=27248 width=35) (actual time=25.262..25.262 rows=27248 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1804kB
15. 9.019 9.019 ↑ 1.0 27248 1

Seq Scan on afiliacao_cielo_mob_diretor mob (cost=0.00..668.48 rows=27248 width=35) (actual time=0.003..9.019 rows=27248 loops=1)

16. 0.311 30.647 ↓ 4.2 536 1

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

17. 30.336 30.336 ↓ 4.2 536 1

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

18. 0.016 137.259 ↓ 24.0 24 1

Subquery Scan on "*SELECT* 2" (cost=6860.73..7682.26 rows=1 width=76) (actual time=115.206..137.259 rows=24 loops=1)

19. 22.449 137.243 ↓ 24.0 24 1

Hash Anti Join (cost=6860.73..7682.25 rows=1 width=76) (actual time=115.203..137.243 rows=24 loops=1)

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

Initplan (forHash Anti Join)

21. 0.002 0.004 ↑ 1.0 1 1

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

22. 0.002 0.002 ↑ 129.0 1 1

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

23. 0.028 0.114 ↓ 7.8 47 1

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

24. 0.037 0.037 ↑ 1.0 1 1

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

  • Index Cond: ((prefdep)::text = ($3)::text)
25. 0.049 0.049 ↓ 7.8 47 1

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

  • Index Cond: ((afiliacao_cielo_mob_diretor.es_prefixo)::bpchar = (d.prefdep)::bpchar)
26. 62.262 114.676 ↑ 1.0 162476 1

Hash (cost=4035.76..4035.76 rows=162476 width=15) (actual time=114.676..114.676 rows=162476 loops=1)

  • Buckets: 16384 Batches: 2 Memory Usage: 3737kB
27. 52.414 52.414 ↑ 1.0 162476 1

Seq Scan on afiliacao_cielo_mob_diretor_publico_alvo (cost=0.00..4035.76 rows=162476 width=15) (actual time=0.005..52.414 rows=162476 loops=1)

28. 0.002 0.071 ↓ 0.0 0 1

Subquery Scan on "*SELECT* 3" (cost=0.02..2476.54 rows=1 width=81) (actual time=0.071..0.071 rows=0 loops=1)

29. 0.000 0.069 ↓ 0.0 0 1

Nested Loop Anti Join (cost=0.02..2476.53 rows=1 width=81) (actual time=0.069..0.069 rows=0 loops=1)

30.          

Initplan (forNested Loop Anti Join)

31. 0.002 0.005 ↑ 1.0 1 1

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

32. 0.003 0.003 ↑ 129.0 1 1

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

33. 0.005 0.068 ↓ 0.0 0 1

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

34. 0.051 0.051 ↑ 1.0 1 1

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

  • Index Cond: ((prefdep)::text = ($2)::text)
35. 0.012 0.012 ↓ 0.0 0 1

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=0.012..0.012 rows=0 loops=1)

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

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

  • Index Cond: (afiliacao_cielo_diretor_ent_sai.es_cpf_cnpj = esporadicos.afiliacao_cielo_mob_diretor_publico_alvo.es_cnpj)
37. 0.430 170.457 ↓ 4.3 560 1

Hash Left Join (cost=2.19..7.46 rows=131 width=274) (actual time=26.053..170.457 rows=560 loops=1)

  • Hash Cond: (((desembolso.prefdep)::bpchar = (desemb_giro_cart.es_prefixo)::bpchar) AND (desembolso.es_cnpj = desemb_giro_cart.es_cpf_cnpj))
38. 1.032 170.014 ↓ 4.3 560 1

Hash Left Join (cost=1.08..5.34 rows=131 width=265) (actual time=26.018..170.014 rows=560 loops=1)

  • Hash Cond: (((desembolso.prefdep)::bpchar = (desemb_acl.es_prefixo)::bpchar) AND ((desembolso.es_cnpj)::bigint = (desemb_acl.es_cpf_cnpj)::bigint))
39. 168.971 168.971 ↓ 4.3 560 1

CTE Scan on desembolso (cost=0.00..2.62 rows=131 width=256) (actual time=25.959..168.971 rows=560 loops=1)

40. 0.001 0.011 ↓ 0.0 0 1

Hash (cost=1.06..1.06 rows=1 width=29) (actual time=0.011..0.011 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 0kB
41. 0.010 0.010 ↓ 0.0 0 1

Seq Scan on afiliacao_cielo_diretor_desembolso desemb_acl (cost=0.00..1.06 rows=1 width=29) (actual time=0.010..0.010 rows=0 loops=1)

  • Filter: ((es_prd = '505'::text) AND (es_mdl = '1'::text))
42. 0.005 0.013 ↑ 1.0 4 1

Hash (cost=1.06..1.06 rows=4 width=29) (actual time=0.013..0.013 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
43. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on afiliacao_cielo_diretor_desembolso desemb_giro_cart (cost=0.00..1.06 rows=4 width=29) (actual time=0.006..0.008 rows=4 loops=1)

  • Filter: ((es_prd = '505'::text) AND (es_mdl = '7'::text))