explain.depesz.com

A tool for finding a real cause for slow queries.

Result: BLg

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.809 297.328 ↓ 25.3 76 1

Unique (cost=3,644.38..3,644.66 rows=3 width=328) (actual time=296.471..297.328 rows=76 loops=1)

2. 24.799 296.519 ↓ 127.7 383 1

Sort (cost=3,644.38..3,644.39 rows=3 width=328) (actual time=296.463..296.519 rows=383 loops=1)

  • Sort Key: tabelarece0_.descricao, receitashi1_.descricao, tabelarece0_.id, receitashi1_.id, receitashi1_.idreceita, tabelarece0_.descricaooficialjustica, tabelarece0_.idfundo, receitashi1_.ativo, receitashi1_.calculardistante, receitashi1_.calcularmesmoendereco, receitashi1_.calcularnumerobens, receitashi1_.codigo, receitashi1_.idconvenio, receitashi1_.idconvenioforoextra, receitashi1_.idconveniooficialjustica, receitashi1_.idconveniorecurso2grau, receitashi1_.idconveniorecursojuizadoespecial, receitashi1_.datacriacao, receitashi1_.disponivelinternet, receitashi1_.emitecertidao, receitashi1_.exigeidentificacao, receitashi1_.exigeparte, receitashi1_.idfundo, receitashi1_.guiaforoextra, receitashi1_.guiaoficialjustica, receitashi1_.guiarecolhimentocusta, receitashi1_.guiarecurso2grau, receitashi1_.guiarecursojuizadoespecial, receitashi1_.naorecolhersecapital, receitashi1_.naorecolherseprocessovirtual, receitashi1_.observacao, receitashi1_.permitequantidade
  • Sort Method: quicksort Memory: 167kB
3. 0.433 271.720 ↓ 127.7 383 1

Nested Loop (cost=0.00..3,644.36 rows=3 width=328) (actual time=9.885..271.720 rows=383 loops=1)

4. 0.226 269.755 ↓ 191.5 383 1

Nested Loop (cost=0.00..3,643.78 rows=2 width=253) (actual time=9.874..269.755 rows=383 loops=1)

5. 2.846 5.529 ↓ 132.0 660 1

Nested Loop (cost=0.00..31.48 rows=5 width=257) (actual time=0.070..5.529 rows=660 loops=1)

  • Join Filter: (receitashi1_.idtabelareceita = materias3_.idtabelareceita)
6. 0.254 0.628 ↓ 137.0 137 1

Merge Join (cost=0.00..28.30 rows=1 width=249) (actual time=0.049..0.628 rows=137 loops=1)

  • Merge Cond: (receitashi1_.id = receita2_.idultimoreceitahistorico)
  • Join Filter: (receitashi1_.idreceita = receita2_.id)
7. 0.279 0.279 ↑ 1.0 202 1

Index Scan using pk_receitahistorico on receitahistorico receitashi1_ (cost=0.00..17.09 rows=202 width=241) (actual time=0.032..0.279 rows=202 loops=1)

  • Filter: (guiarecolhimentocusta AND ativo)
8. 0.095 0.095 ↑ 1.0 155 1

Index Scan using idx_receita_ultimoreceitahistorico on receita receita2_ (cost=0.00..8.58 rows=155 width=8) (actual time=0.009..0.095 rows=155 loops=1)

9. 2.055 2.055 ↑ 1.0 97 137

Seq Scan on tabelareceitamateria materias3_ (cost=0.00..1.97 rows=97 width=8) (actual time=0.002..0.015 rows=97 loops=137)

10. 2.640 264.000 ↑ 1.0 1 660

Index Scan using pk_materia on materia materia4_ (cost=0.00..722.45 rows=1 width=4) (actual time=0.399..0.400 rows=1 loops=660)

  • Index Cond: (materia4_.id = materias3_.idmateria)
  • Filter: (subplan)
11.          

SubPlan (forIndex Scan)

12. 42.240 261.360 ↑ 9.7 3 660

Unique (cost=669.98..774.18 rows=29 width=4) (actual time=0.028..0.396 rows=3 loops=660)

13. 72.814 219.120 ↑ 13.5 439 660

Result (cost=669.98..759.31 rows=5,947 width=4) (actual time=0.026..0.332 rows=439 loops=660)

  • One-Time Filter: ($0 = ANY ('{1,2,3,4,5,6,7,8,9,10,11}'::integer[]))
14. 98.048 146.306 ↑ 7.9 757 383

Merge Join (cost=669.98..759.31 rows=5,947 width=4) (actual time=0.043..0.382 rows=757 loops=383)

  • Merge Cond: (materia9_.id = materias8_.idmateria)
15. 3.830 6.511 ↑ 5.8 5 383

Sort (cost=1.99..2.07 rows=29 width=4) (actual time=0.017..0.017 rows=5 loops=383)

  • Sort Key: materia9_.id
16. 2.681 2.681 ↑ 1.0 29 383

Seq Scan on materia materia9_ (cost=0.00..1.29 rows=29 width=4) (actual time=0.002..0.007 rows=29 loops=383)

17. 34.941 41.747 ↑ 7.9 757 383

Sort (cost=667.97..682.84 rows=5,947 width=4) (actual time=0.026..0.109 rows=757 loops=383)

  • Sort Key: materias8_.idmateria
  • Sort Method: quicksort Memory: 452kB
18. 2.703 6.806 ↑ 1.1 5,528 1

Hash Join (cost=113.56..295.16 rows=5,947 width=4) (actual time=3.142..6.806 rows=5,528 loops=1)

  • Hash Cond: (materias8_.idunidadearrecadadorahistorico = unidadearr5_.idultimounidadearrecadadorahistoricoinstalado)
19. 1.003 1.003 ↑ 1.0 5,942 1

Seq Scan on unidademateria materias8_ (cost=0.00..92.42 rows=5,942 width=8) (actual time=0.008..1.003 rows=5,942 loops=1)

20. 0.450 3.100 ↑ 1.0 1,096 1

Hash (cost=99.86..99.86 rows=1,096 width=8) (actual time=3.100..3.100 rows=1,096 loops=1)

21. 0.528 2.650 ↑ 1.0 1,096 1

Hash Join (cost=39.22..99.86 rows=1,096 width=8) (actual time=1.266..2.650 rows=1,096 loops=1)

  • Hash Cond: (unidadearr5_.idcomarca = comarca6_.id)
22. 0.644 1.938 ↑ 1.0 1,096 1

Hash Join (cost=34.66..80.23 rows=1,096 width=12) (actual time=1.057..1.938 rows=1,096 loops=1)

  • Hash Cond: (unidadearr7_.id = unidadearr5_.idultimounidadearrecadadorahistoricoinstalado)
23. 0.276 0.276 ↑ 1.0 1,174 1

Seq Scan on unidadearrecadadorahistorico unidadearr7_ (cost=0.00..28.74 rows=1,174 width=4) (actual time=0.009..0.276 rows=1,174 loops=1)

24. 0.551 1.018 ↑ 1.0 1,096 1

Hash (cost=20.96..20.96 rows=1,096 width=8) (actual time=1.018..1.018 rows=1,096 loops=1)

25. 0.467 0.467 ↑ 1.0 1,096 1

Seq Scan on unidadearrecadadora unidadearr5_ (cost=0.00..20.96 rows=1,096 width=8) (actual time=0.010..0.467 rows=1,096 loops=1)

26. 0.138 0.184 ↑ 1.0 158 1

Hash (cost=2.58..2.58 rows=158 width=4) (actual time=0.184..0.184 rows=158 loops=1)

27. 0.046 0.046 ↑ 1.0 158 1

Seq Scan on comarca comarca6_ (cost=0.00..2.58 rows=158 width=4) (actual time=0.014..0.046 rows=158 loops=1)

28. 1.532 1.532 ↑ 1.0 1 383

Index Scan using pk_tabelareceita on tabelareceita tabelarece0_ (cost=0.00..0.27 rows=1 width=79) (actual time=0.003..0.004 rows=1 loops=383)

  • Index Cond: (tabelarece0_.id = receitashi1_.idtabelareceita)