explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UZaV

Settings
# exclusive inclusive rows x rows loops node
1. 1.389 8.887 ↓ 2.4 164 1

WindowAgg (cost=1.57..631.52 rows=67 width=128) (actual time=0.652..8.887 rows=164 loops=1)

2. 1.005 7.498 ↓ 2.4 164 1

Append (cost=1.57..630.68 rows=67 width=120) (actual time=0.600..7.498 rows=164 loops=1)

3. 0.006 0.199 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=1.57..6.48 rows=1 width=106) (actual time=0.196..0.199 rows=0 loops=1)

4. 0.007 0.193 ↓ 0.0 0 1

Merge Join (cost=1.57..6.47 rows=1 width=110) (actual time=0.190..0.193 rows=0 loops=1)

  • Merge Cond: ((a.codigocatalogoservicoagregado)::text = (b.codigocatalogoservicoagregado)::text)
5. 0.186 0.186 ↓ 0.0 0 1

Index Scan using idx_fkempresa_ccservicoagregado_servicosagregadosxservicos on servicosagregadosxservicos a (cost=0.41..19.93 rows=4 width=28) (actual time=0.183..0.186 rows=0 loops=1)

  • Index Cond: ((fkempresa = 64) AND (excluido = false) AND (excluido = false))
  • Filter: ((NOT excluido) AND (NOT excluido))
6. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.16..1.16 rows=1 width=24) (never executed)

  • Sort Key: b.codigocatalogoservicoagregado
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on servicosagregadosxveiculosmodelosxrevisoes b (cost=0.00..1.15 rows=1 width=24) (never executed)

  • Filter: ((NOT excluido) AND (fkempresa = 64) AND ((codigocatalogorevisao)::text = '2822'::text))
8. 0.006 0.094 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.70..16.63 rows=1 width=106) (actual time=0.091..0.094 rows=0 loops=1)

9. 0.006 0.088 ↓ 0.0 0 1

Nested Loop (cost=0.70..16.62 rows=1 width=110) (actual time=0.085..0.088 rows=0 loops=1)

10. 0.082 0.082 ↓ 0.0 0 1

Index Scan using idx_fkempresa_ccagregado_servicosagragadosxmodelosxrevisoes on servicosagregadosxveiculosversoesxrevisoes b_1 (cost=0.28..8.17 rows=1 width=31) (actual time=0.079..0.082 rows=0 loops=1)

  • Index Cond: ((fkempresa = 64) AND (excluido = false))
  • Filter: ((NOT excluido) AND ((codigocatalogorevisao)::text = '2822'::text))
11. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_fkempresa_ccservicoagregado_servicosagregadosxservicos on servicosagregadosxservicos a_1 (cost=0.41..8.44 rows=1 width=28) (never executed)

  • Index Cond: ((fkempresa = 64) AND ((codigocatalogoservicoagregado)::text = (b_1.codigocatalogoservicoagregado)::text) AND (excluido = false) AND (excluido = false))
  • Filter: ((NOT excluido) AND (NOT excluido))
12. 1.103 3.994 ↓ 2.7 164 1

Subquery Scan on *SELECT* 3 (cost=5.28..196.45 rows=60 width=123) (actual time=0.299..3.994 rows=164 loops=1)

13. 2.684 2.891 ↓ 2.7 164 1

Bitmap Heap Scan on servicosxveiculosmodelosxrevisoes a_2 (cost=5.28..195.85 rows=60 width=127) (actual time=0.293..2.891 rows=164 loops=1)

  • Recheck Cond: ((fkempresa = 64) AND ((codigocatalogorevisao)::text = '2822'::text))
  • Filter: ((NOT excluido) AND (NOT excluido))
  • Rows Removed by Filter: 169
  • Heap Blocks: exact=79
14. 0.207 0.207 ↓ 3.4 333 1

Bitmap Index Scan on idx_fkempresa_ccrev_servxveicmodxrev (cost=0.00..5.27 rows=98 width=0) (actual time=0.204..0.207 rows=333 loops=1)

  • Index Cond: ((fkempresa = 64) AND ((codigocatalogorevisao)::text = '2822'::text))
15. 0.006 0.089 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=0.28..8.08 rows=1 width=125) (actual time=0.086..0.089 rows=0 loops=1)

16. 0.083 0.083 ↓ 0.0 0 1

Index Scan using idx_fkempresa_ccrev_servxveiverxrev on servicosxveiculosversoesxrevisoes a_3 (cost=0.28..8.07 rows=1 width=129) (actual time=0.080..0.083 rows=0 loops=1)

  • Index Cond: ((fkempresa = 64) AND ((codigocatalogorevisao)::text = '2822'::text))
  • Filter: ((NOT excluido) AND (NOT excluido))
17. 0.006 1.986 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=115.28..368.18 rows=1 width=95) (actual time=1.983..1.986 rows=0 loops=1)

18. 1.217 1.980 ↓ 0.0 0 1

Bitmap Heap Scan on pacotesxveiculosmodelosxrevisaoxservicos a_4 (cost=115.28..368.17 rows=1 width=99) (actual time=1.977..1.980 rows=0 loops=1)

  • Recheck Cond: (fkempresa = 64)
  • Filter: ((NOT excluido) AND (NOT excluido) AND ((codigocatalogorevisao)::text = '2822'::text) AND ((codigocatalogopacote)::text = ''::text))
  • Rows Removed by Filter: 2280
  • Heap Blocks: exact=26
19. 0.763 0.763 ↑ 1.1 2,329 1

Bitmap Index Scan on idx_fkempresa_ccmod_pacxveimodxrevxser (cost=0.00..115.28 rows=2,508 width=0) (actual time=0.760..0.763 rows=2,329 loops=1)

  • Index Cond: ((fkempresa = 64) AND (excluido = false) AND (excluido = false))
20. 0.006 0.066 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6 (cost=0.27..7.60 rows=1 width=95) (actual time=0.063..0.066 rows=0 loops=1)

21. 0.060 0.060 ↓ 0.0 0 1

Index Scan using idx_fkempresa_ccrev_pacxveimodxrevxser on pacotesxveiculosversoesxrevisaoxservicos a_5 (cost=0.27..7.59 rows=1 width=99) (actual time=0.057..0.060 rows=0 loops=1)

  • Index Cond: ((fkempresa = 64) AND ((codigocatalogorevisao)::text = '2822'::text))
  • Filter: ((NOT excluido) AND (NOT excluido) AND ((codigocatalogopacote)::text = ''::text))
22. 0.007 0.032 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7 (cost=0.70..13.61 rows=1 width=77) (actual time=0.029..0.032 rows=0 loops=1)

23. 0.006 0.025 ↓ 0.0 0 1

Merge Join (cost=0.70..13.60 rows=1 width=81) (actual time=0.023..0.025 rows=0 loops=1)

  • Merge Cond: ((a_6.codigocatalogoservicoagregado)::text = (b_2.codigocatalogoservicoagregado)::text)
24. 0.019 0.019 ↓ 0.0 0 1

Index Scan using idx_fkempresa_ccservicoagregado_servicosagregadosxservicos on servicosagregadosxservicos a_6 (cost=0.41..19.93 rows=4 width=28) (actual time=0.016..0.019 rows=0 loops=1)

  • Index Cond: ((fkempresa = 64) AND (excluido = false) AND (excluido = false))
  • Filter: ((NOT excluido) AND (NOT excluido))
25. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_emp_ccservagr_excl_pacxveimodxrevxserag on pacotesxveiculosmodelosxrevisoesxservicosagregados b_2 (cost=0.28..8.30 rows=1 width=25) (never executed)

  • Index Cond: ((fkempresa = 64) AND (excluido = false))
  • Filter: ((NOT excluido) AND ((codigocatalogorevisao)::text = '2822'::text) AND ((codigocatalogopacote)::text = ''::text))
26. 0.006 0.033 ↓ 0.0 0 1

Subquery Scan on *SELECT* 8 (cost=0.69..13.32 rows=1 width=76) (actual time=0.030..0.033 rows=0 loops=1)

27. 0.006 0.027 ↓ 0.0 0 1

Merge Join (cost=0.69..13.31 rows=1 width=80) (actual time=0.024..0.027 rows=0 loops=1)

  • Merge Cond: ((a_7.codigocatalogoservicoagregado)::text = (b_3.codigocatalogoservicoagregado)::text)
28. 0.021 0.021 ↓ 0.0 0 1

Index Scan using idx_fkempresa_ccservicoagregado_servicosagregadosxservicos on servicosagregadosxservicos a_7 (cost=0.41..19.93 rows=4 width=28) (actual time=0.018..0.021 rows=0 loops=1)

  • Index Cond: ((fkempresa = 64) AND (excluido = false) AND (excluido = false))
  • Filter: ((NOT excluido) AND (NOT excluido))
29. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_emp_ccservagr_excl_pacxveiverxrevxservagreg on pacotesxveiculosversoesxrevisoesxservicosagregados b_3 (cost=0.27..8.00 rows=1 width=24) (never executed)

  • Index Cond: ((fkempresa = 64) AND (excluido = false))
  • Filter: ((NOT excluido) AND ((codigocatalogorevisao)::text = '2822'::text) AND ((codigocatalogopacote)::text = ''::text))
Planning time : 7.883 ms
Execution time : 10.439 ms