explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BCRg : somente filial

Settings
# exclusive inclusive rows x rows loops node
1. 0.049 1.444 ↑ 120.9 16 1

Nested Loop (cost=39.86..12,489,915.02 rows=1,935 width=585) (actual time=0.301..1.444 rows=16 loops=1)

2. 0.024 0.051 ↑ 72.0 16 1

HashAggregate (cost=35.75..47.27 rows=1,152 width=8) (actual time=0.035..0.051 rows=16 loops=1)

  • Group Key: objetoatualizadosincro.idobjetoatualizado
3. 0.027 0.027 ↑ 72.6 16 1

Index Only Scan using ix_objetoatualizadosincro_idfilasincro_tipoatualizacaoobjetosin on objetoatualizadosincro (cost=0.43..32.85 rows=1,161 width=8) (actual time=0.026..0.027 rows=16 loops=1)

  • Index Cond: (idfilasincro = 548,995)
  • Heap Fetches: 0
4. 0.032 1.344 ↑ 1,002,501.0 1 16

Nested Loop (cost=4.11..816.78 rows=1,002,501 width=296) (actual time=0.080..0.084 rows=1 loops=16)

5. 0.048 0.048 ↑ 1.0 1 16

Index Scan using ix_filial_codempresa_codfilial on filial d (cost=0.14..2.36 rows=1 width=33) (actual time=0.003..0.003 rows=1 loops=16)

  • Index Cond: ((codfilial)::text = '1'::text)
6. 0.032 1.264 ↑ 79,515.0 1 16

Nested Loop (cost=3.96..19.27 rows=79,515 width=294) (actual time=0.076..0.079 rows=1 loops=16)

  • Join Filter: ((d.codempresa)::text = (a.codigoempresa)::text)
7. 0.064 0.064 ↑ 1.0 1 16

Index Scan using produtovariacao_pkey on produtovariacao a (cost=0.43..2.50 rows=1 width=46) (actual time=0.003..0.004 rows=1 loops=16)

  • Index Cond: (id = objetoatualizadosincro.idobjetoatualizado)
8. 0.016 1.168 ↑ 2.0 1 16

Nested Loop (cost=3.54..16.74 rows=2 width=269) (actual time=0.070..0.073 rows=1 loops=16)

9. 0.000 1.088 ↑ 1.0 1 16

Nested Loop (cost=3.39..16.57 rows=1 width=264) (actual time=0.066..0.068 rows=1 loops=16)

10. 0.144 0.144 ↑ 1.0 1 16

Index Only Scan using "IX_CEP_cep__codigocidade" on cep e (cost=0.43..1.55 rows=1 width=14) (actual time=0.008..0.009 rows=1 loops=16)

  • Index Cond: (cep = (d.codigocep)::text)
  • Heap Fetches: 0
11. 0.016 0.944 ↑ 1.0 1 16

Nested Loop (cost=2.96..15.01 rows=1 width=261) (actual time=0.056..0.059 rows=1 loops=16)

12. 0.080 0.080 ↑ 1.0 1 16

Index Only Scan using ix_cidade_codigo_uf on cidade f (cost=0.28..0.30 rows=1 width=9) (actual time=0.005..0.005 rows=1 loops=16)

  • Index Cond: (codigo = (e.codigocidade)::text)
  • Heap Fetches: 0
13. 0.032 0.848 ↑ 1.0 1 16

Nested Loop (cost=2.68..14.70 rows=1 width=252) (actual time=0.051..0.053 rows=1 loops=16)

  • Join Filter: (((b.codigoempresa)::text = (c.codigoempresa)::text) AND (b.tipoestoque = c.tipoestoque) AND ((b.codigo)::text = (c.codigoproduto)::text))
14. 0.032 0.592 ↑ 1.0 1 16

Nested Loop (cost=2.12..13.36 rows=1 width=222) (actual time=0.035..0.037 rows=1 loops=16)

15. 0.160 0.160 ↑ 1.0 1 16

Index Scan using ix_produto_codigoempresa_tipoestoque_codigo on produto b (cost=0.42..0.46 rows=1 width=175) (actual time=0.010..0.010 rows=1 loops=16)

  • Index Cond: (((codigoempresa)::text = (a.codigoempresa)::text) AND (tipoestoque = a.tipoestoque) AND ((codigo)::text = (a.codigoproduto)::text))
  • Filter: ((idunidademedida IS NOT NULL) AND (idfamiliaproduto IS NOT NULL) AND (idclassificacaofiscal IS NOT NULL) AND ((nomeecf)::text <> ''::text))
16. 0.016 0.400 ↑ 1.0 1 16

Nested Loop Left Join (cost=1.69..12.88 rows=1 width=47) (actual time=0.024..0.025 rows=1 loops=16)

17. 0.016 0.288 ↑ 1.0 1 16

Nested Loop Left Join (cost=1.40..10.33 rows=1 width=20) (actual time=0.017..0.018 rows=1 loops=16)

18. 0.016 0.272 ↑ 1.0 1 16

Nested Loop Left Join (cost=0.98..7.67 rows=1 width=16) (actual time=0.017..0.017 rows=1 loops=16)

19. 0.000 0.208 ↑ 1.0 1 16

Nested Loop Left Join (cost=0.84..5.29 rows=1 width=10) (actual time=0.013..0.013 rows=1 loops=16)

20. 0.160 0.160 ↑ 1.0 1 16

Index Scan using ix_tributacaoproduto_codigoempresa_tipoestoque_codigoproduto on tributacaoproduto x (cost=0.42..2.65 rows=1 width=2) (actual time=0.009..0.010 rows=1 loops=16)

  • Index Cond: (((codigoempresa)::text = (b.codigoempresa)::text) AND (tipoestoque = a.tipoestoque) AND ((codigoproduto)::text = (a.codigoproduto)::text))
21. 0.048 0.048 ↑ 1.0 1 16

Index Scan using ix_sys025_idprodutofilho on sys025 y (cost=0.42..2.64 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=16)

  • Index Cond: (idprodutofilho = a.idproduto)
22. 0.048 0.048 ↓ 0.0 0 16

Index Scan using ix_sys004_syscenufor_syscenufde_natopec_cenina_peroric_perdes on sys004 w (cost=0.14..2.37 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=16)

  • Index Cond: (((syscenufor)::text = (f.uf)::text) AND ((syscenufde)::text = (f.uf)::text) AND (sysnatopec = 121) AND (syscenina = 0) AND (sysperoric = 3) AND (sysperdesc = 6) AND (syscenicml = 1))
23. 0.000 0.000 ↓ 0.0 0 16

Index Scan using ix_sys020_idproduto_idcenario_syscenlibi on sys020 k (cost=0.42..2.65 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=16)

  • Index Cond: ((idproduto = y.idproduto) AND (idcenario = w.id))
  • Filter: (((syscenlibi = 1) AND (w.syscenicml = 0)) OR (w.syscenicml = 1))
24. 0.096 0.096 ↑ 1.0 1 16

Index Scan using ix_tributacaoestado_codigoempresa_codigo_uforigem_ufdestino on tributacaoestado t2 (cost=0.29..2.51 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=16)

  • Index Cond: (((codigoempresa)::text = (b.codigoempresa)::text) AND (codigo = COALESCE(k.systrbgrpc, x.codigo)) AND ((uforigem)::text = (f.uf)::text) AND ((ufdestino)::text = (f.uf)::text))
25. 0.224 0.224 ↑ 1.0 1 16

Index Scan using ix_preco_codigoempresa_tipoestoque_codigoproduto_codigofilial on preco c (cost=0.56..1.33 rows=1 width=30) (actual time=0.014..0.014 rows=1 loops=16)

  • Index Cond: (((codigoempresa)::text = (a.codigoempresa)::text) AND (tipoestoque = a.tipoestoque) AND ((codigoproduto)::text = (a.codigoproduto)::text) AND ((codigofilial)::text = '1'::text))
26. 0.064 0.064 ↑ 1.0 1 16

Index Scan using ix_unidademedida_codigoempresa_sigla on unidademedida i (cost=0.14..0.17 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=16)

  • Index Cond: (((codigoempresa)::text = (b.codigoempresa)::text) AND ((sigla)::text = (b.unidademedida)::text))
Planning time : 35.973 ms
Execution time : 1.949 ms