explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2qoX

Settings
# exclusive inclusive rows x rows loops node
1. 0.322 12.222 ↓ 84.0 84 1

Nested Loop (cost=8.62..48.29 rows=1 width=74) (actual time=0.313..12.222 rows=84 loops=1)

2.          

CTE financeiroconta_cte

3. 0.022 0.067 ↑ 1.0 1 1

Nested Loop (cost=0.00..5.27 rows=1 width=14) (actual time=0.048..0.067 rows=1 loops=1)

  • Join Filter: (a.idempresa = b.id)
  • Rows Removed by Join Filter: 7
4. 0.036 0.036 ↑ 1.0 1 1

Seq Scan on financeiroconta a (cost=0.00..4.09 rows=1 width=4) (actual time=0.027..0.036 rows=1 loops=1)

  • Filter: (id = 2)
  • Rows Removed by Filter: 64
5. 0.009 0.009 ↑ 1.0 8 1

Seq Scan on empresa b (cost=0.00..1.08 rows=8 width=18) (actual time=0.003..0.009 rows=8 loops=1)

6. 0.411 11.270 ↓ 105.0 105 1

Nested Loop (cost=3.06..39.51 rows=1 width=74) (actual time=0.284..11.270 rows=105 loops=1)

  • Join Filter: ("substring"((empresa.cnpj)::text, 0, "position"((empresa.cnpj)::text, '/'::text)) = financeiroconta_cte.raizcnpj)
  • Rows Removed by Join Filter: 16
7. 1.181 10.496 ↓ 121.0 121 1

Nested Loop (cost=3.06..39.48 rows=1 width=88) (actual time=0.226..10.496 rows=121 loops=1)

8. 1.366 8.857 ↓ 458.0 458 1

Nested Loop (cost=2.92..39.31 rows=1 width=74) (actual time=0.210..8.857 rows=458 loops=1)

9. 1.712 5.201 ↓ 458.0 458 1

Nested Loop (cost=2.50..31.33 rows=1 width=45) (actual time=0.199..5.201 rows=458 loops=1)

10. 0.929 1.657 ↓ 458.0 458 1

Hash Left Join (cost=2.21..26.98 rows=1 width=45) (actual time=0.170..1.657 rows=458 loops=1)

  • Hash Cond: (financeirofuncionariovale.id = financeirofuncionariovalebaixa.idfinanceirofuncionariovale)
  • Filter: (financeirofuncionariovalebaixa.id IS NULL)
  • Rows Removed by Filter: 64
11. 0.606 0.606 ↑ 1.0 506 1

Seq Scan on financeirofuncionariovale (cost=0.00..21.06 rows=506 width=45) (actual time=0.019..0.606 rows=506 loops=1)

12. 0.064 0.122 ↓ 1.2 64 1

Hash (cost=1.54..1.54 rows=54 width=8) (actual time=0.122..0.122 rows=64 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
13. 0.058 0.058 ↓ 1.2 64 1

Seq Scan on financeirofuncionariovalebaixa (cost=0.00..1.54 rows=54 width=8) (actual time=0.003..0.058 rows=64 loops=1)

14. 1.832 1.832 ↑ 1.0 1 458

Index Scan using financeirolancamentoitem_pkey on financeirolancamentoitem (cost=0.29..4.34 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=458)

  • Index Cond: (id = financeirofuncionariovale.idfinanceirolancamentoitem)
15. 2.290 2.290 ↑ 1.0 1 458

Index Scan using pessoa_pkey on pessoa (cost=0.42..7.98 rows=1 width=33) (actual time=0.004..0.005 rows=1 loops=458)

  • Index Cond: (id = financeirofuncionariovale.idpessoa)
16. 0.458 0.458 ↓ 0.0 0 458

Index Scan using empresa_pkey on empresa (cost=0.13..0.15 rows=1 width=22) (actual time=0.001..0.001 rows=0 loops=458)

  • Index Cond: (id = pessoa.idempresaregistro)
17. 0.363 0.363 ↑ 1.0 1 121

CTE Scan on financeiroconta_cte (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.003 rows=1 loops=121)

18. 0.630 0.630 ↑ 1.0 1 105

Index Scan using financeirolancamento_pkey on financeirolancamento (cost=0.29..3.50 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=105)

  • Index Cond: (id = financeirolancamentoitem.idfinanceirolancamento)
  • Filter: (dataestorno IS NULL)
  • Rows Removed by Filter: 0