explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TGyU : Optimization for: Optimization for: plan #5QS6; plan #HJJ9

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.013 139.052 ↑ 1.0 1 1

Sort (cost=7.87..7.88 rows=1 width=242) (actual time=139.052..139.052 rows=1 loops=1)

  • Sort Key: a.posizione
  • Sort Method: quicksort Memory: 25kB
2. 0.016 139.039 ↑ 1.0 1 1

Nested Loop (cost=0.15..7.86 rows=1 width=242) (actual time=139.036..139.039 rows=1 loops=1)

  • Join Filter: (a.id_misura_t = b.id)
  • Rows Removed by Join Filter: 4
3. 0.074 0.074 ↑ 1.0 1 1

Index Scan using idx_2_loc on misure_linee a (cost=0.15..2.37 rows=1 width=16) (actual time=0.071..0.074 rows=1 loops=1)

  • Index Cond: ((id_aziende = 13) AND (id_linea = 40))
4. 0.018 0.018 ↓ 5.0 5 1

Seq Scan on misure_t b (cost=0.00..1.40 rows=1 width=226) (actual time=0.017..0.018 rows=5 loops=1)

  • Filter: (id_aziende = 13)
  • Rows Removed by Filter: 9
5.          

SubPlan (forNested Loop)

6. 0.002 0.027 ↑ 1.0 1 1

Aggregate (cost=1.29..1.30 rows=1 width=8) (actual time=0.027..0.027 rows=1 loops=1)

7. 0.025 0.025 ↓ 0.0 0 1

Index Only Scan using idx__loc_1 on misure_linee_dettaglio (cost=0.14..1.29 rows=2 width=0) (actual time=0.025..0.025 rows=0 loops=1)

  • Index Cond: ((id_misure_linee = a.id) AND (attiva = true))
  • Filter: attiva
  • Heap Fetches: 0
8. 0.002 138.904 ↑ 1.0 1 1

Limit (cost=0.42..2.78 rows=1 width=12) (actual time=138.902..138.904 rows=1 loops=1)

9. 138.902 138.902 ↑ 5,075.0 1 1

Index Scan Backward using ticket_misura_pkey on ticket_misura (cost=0.42..11,983.58 rows=5,075 width=12) (actual time=138.902..138.902 rows=1 loops=1)

  • Filter: (id_misure_linee = a.id)
  • Rows Removed by Filter: 273174
Planning time : 0.411 ms
Execution time : 139.128 ms