explain.depesz.com

A tool for finding a real cause for slow queries.

Result: q92

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.029 75.772 ↑ 77.4 8 1

Sort (cost=3254.19..3255.74 rows=619 width=42) (actual time=75.771..75.772 rows=8 loops=1)

  • Sort Key: (sum("*SELECT* 1".dcc_valor))
  • Sort Method: quicksort Memory: 25kB
2.          

CTE prefixo

3. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

4. 0.142 75.743 ↑ 77.4 8 1

HashAggregate (cost=3216.19..3225.48 rows=619 width=42) (actual time=75.738..75.743 rows=8 loops=1)

5. 0.156 75.601 ↑ 12.8 130 1

Hash Left Join (cost=1619.76..3207.88 rows=1662 width=42) (actual time=46.446..75.601 rows=130 loops=1)

  • Hash Cond: ((("*SELECT* 1".dcc_produto)::integer) = produtos.p_produto)
6. 0.004 72.807 ↑ 37.2 9 1

Append (cost=1440.31..2892.50 rows=335 width=11) (actual time=43.760..72.807 rows=9 loops=1)

7. 0.011 43.767 ↑ 1.0 7 1

Subquery Scan on "*SELECT* 1" (cost=1440.31..1440.40 rows=7 width=13) (actual time=43.760..43.767 rows=7 loops=1)

8. 0.000 43.756 ↑ 1.0 7 1

Limit (cost=1440.31..1440.33 rows=7 width=13) (actual time=43.752..43.756 rows=7 loops=1)

9.          

Initplan (forLimit)

10. 0.005 0.005 ↑ 1.0 1 1

CTE Scan on prefixo (cost=0.00..0.02 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=1)

11. 0.028 43.752 ↑ 47.9 7 1

Sort (cost=1440.29..1441.13 rows=335 width=13) (actual time=43.750..43.752 rows=7 loops=1)

  • Sort Key: gpspj.dash_composicao_carteiras.dcc_valor
  • Sort Method: quicksort Memory: 25kB
12. 43.724 43.724 ↑ 37.2 9 1

Seq Scan on dash_composicao_carteiras (cost=0.00..1433.92 rows=335 width=13) (actual time=42.560..43.724 rows=9 loops=1)

  • Filter: ((dcc_prefixo)::text = $2)
13. 0.003 29.036 ↑ 164.0 2 1

Subquery Scan on "*SELECT* 2" (cost=1448.00..1452.10 rows=328 width=11) (actual time=29.034..29.036 rows=2 loops=1)

14. 0.001 29.033 ↑ 164.0 2 1

Limit (cost=1448.00..1448.82 rows=328 width=11) (actual time=29.032..29.033 rows=2 loops=1)

15.          

Initplan (forLimit)

16. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on prefixo (cost=0.00..0.02 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=1)

17. 0.029 29.030 ↑ 37.2 9 1

Sort (cost=1447.96..1448.80 rows=335 width=11) (actual time=29.028..29.030 rows=9 loops=1)

  • Sort Key: gpspj.dash_composicao_carteiras.dcc_valor
  • Sort Method: quicksort Memory: 25kB
18. 29.001 29.001 ↑ 37.2 9 1

Seq Scan on dash_composicao_carteiras (cost=0.00..1433.92 rows=335 width=11) (actual time=27.837..29.001 rows=9 loops=1)

  • Filter: ((dcc_prefixo)::text = $1)
19. 1.410 2.638 ↑ 1.0 4331 1

Hash (cost=125.31..125.31 rows=4331 width=29) (actual time=2.638..2.638 rows=4331 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 265kB
20. 1.228 1.228 ↑ 1.0 4331 1

Seq Scan on produtos (cost=0.00..125.31 rows=4331 width=29) (actual time=0.004..1.228 rows=4331 loops=1)