explain.depesz.com

A tool for finding a real cause for slow queries.

Result: Wqi

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

Append (cost=6915.73..6994.97 rows=130 width=255) (actual time=0.128..66.650 rows=135 loops=1)

2.          

CTE afiliados

3. 0.213 66.191 ↓ 1.0 133 1

Nested Loop Left Join (cost=6074.99..6915.73 rows=129 width=167) (actual time=0.122..66.191 rows=133 loops=1)

  • Join Filter: ((dados.prefdep)::bpchar = (mob.es_prefixo)::bpchar)
4.          

CTE dados

5. 40.255 64.469 ↓ 1.0 133 1

Nested Loop Left Join (cost=0.00..6074.99 rows=130 width=86) (actual time=0.098..64.469 rows=133 loops=1)

  • Join Filter: ((d.prefdep)::bpchar = (alvo.es_prefixo)::bpchar)
6. 0.022 0.022 ↑ 1.0 1 1

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

  • Index Cond: ((prefdep)::text = '0018'::text)
7. 24.192 24.192 ↑ 1.0 162476 1

Seq Scan on afiliacao_cielo_mob_diretor_publico_alvo alvo (cost=0.00..4035.76 rows=162476 width=86) (actual time=0.003..24.192 rows=162476 loops=1)

8. 64.648 64.648 ↓ 1.0 133 1

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

  • Filter: (es_razao_social IS NOT NULL)
9. 1.330 1.330 ↓ 0.0 0 133

Index Scan using afiliacao_cielo_mob_diretor_es_cpf_cnpj_idx on afiliacao_cielo_mob_diretor mob (cost=0.00..6.47 rows=1 width=35) (actual time=0.010..0.010 rows=0 loops=133)

  • Index Cond: (dados.es_cnpj = mob.es_cpf_cnpj)
10. 0.086 66.487 ↓ 1.0 133 1

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

11. 66.401 66.401 ↓ 1.0 133 1

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

12. 0.003 0.125 ↓ 2.0 2 1

Subquery Scan on "*SELECT* 2" (cost=0.02..75.37 rows=1 width=76) (actual time=0.091..0.125 rows=2 loops=1)

13. 0.013 0.122 ↓ 2.0 2 1

Nested Loop Anti Join (cost=0.02..75.36 rows=1 width=76) (actual time=0.089..0.122 rows=2 loops=1)

14.          

Initplan (forNested Loop Anti Join)

15. 0.002 0.006 ↑ 1.0 1 1

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

16. 0.004 0.004 ↑ 129.0 1 1

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

17. 0.006 0.061 ↑ 2.0 3 1

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

18. 0.040 0.040 ↑ 1.0 1 1

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

  • Index Cond: ((prefdep)::text = ($2)::text)
19. 0.015 0.015 ↑ 2.0 3 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.013..0.015 rows=3 loops=1)

  • Index Cond: ((afiliacao_cielo_mob_diretor.es_prefixo)::bpchar = (d.prefdep)::bpchar)
20. 0.042 0.042 ↓ 0.0 0 3

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

  • Index Cond: (afiliacao_cielo_mob_diretor.es_cpf_cnpj = afiliacao_cielo_mob_diretor_publico_alvo.es_cnpj)