explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oEPo

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Delete on pesagem pe (cost=21,024.25..21,292.72 rows=1,245,322 width=38) (actual rows= loops=)

2.          

CTE list

3. 0.000 0.000 ↓ 0.0

Delete on passagem (cost=0.43..8,802.60 rows=166,877 width=6) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Index Scan using passagem_entrada_primeiro_laco_idx on passagem (cost=0.43..8,802.60 rows=166,877 width=6) (actual rows= loops=)

  • Index Cond: (entrada_primeiro_laco < (now() - '29 days'::interval))
5.          

CTE delete_eixos

6. 0.000 0.000 ↓ 0.0

Delete on pesagem_eixo pei (cost=3,755.30..8,466.49 rows=24,655,846 width=38) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,755.30..8,466.49 rows=24,655,846 width=38) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,754.73..3,756.73 rows=200 width=40) (actual rows= loops=)

  • Group Key: list_1.id_pesagem
9. 0.000 0.000 ↓ 0.0

CTE Scan on list list_1 (cost=0.00..3,337.54 rows=166,877 width=40) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Scan using pesagem_eixo_pesagem_idx on pesagem_eixo pei (cost=0.56..20.96 rows=259 width=14) (actual rows= loops=)

  • Index Cond: (pesagem = list_1.id_pesagem)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,755.16..4,023.63 rows=1,245,322 width=38) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,754.73..3,756.73 rows=200 width=40) (actual rows= loops=)

  • Group Key: list.id_pesagem
13. 0.000 0.000 ↓ 0.0

CTE Scan on list (cost=0.00..3,337.54 rows=166,877 width=40) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using pesagem_pkey on pesagem pe (cost=0.43..1.32 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (id = list.id_pesagem)