explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ItCm

Settings
# exclusive inclusive rows x rows loops node
1. 1.108 181.429 ↓ 1,254.0 1,254 1

Sort (cost=32.54..32.55 rows=1 width=135) (actual time=181.111..181.429 rows=1,254 loops=1)

  • Sort Key: (max(a.triggered)) DESC
  • Sort Method: quicksort Memory: 381kB
  • Buffers: shared hit=127,267
2. 7.874 180.321 ↓ 1,254.0 1,254 1

GroupAggregate (cost=32.49..32.53 rows=1 width=135) (actual time=168.570..180.321 rows=1,254 loops=1)

  • Group Key: a.id_vehicle, b.id, (CASE WHEN (vr.name IS NULL) THEN b.i18n_key ELSE vr.name END), c.code, c.name
  • Buffers: shared hit=127,264
3. 18.006 172.447 ↓ 15,220.0 15,220 1

Sort (cost=32.49..32.50 rows=1 width=95) (actual time=168.550..172.447 rows=15,220 loops=1)

  • Sort Key: a.id_vehicle, b.id, (CASE WHEN (vr.name IS NULL) THEN b.i18n_key ELSE vr.name END), c.code, c.name
  • Sort Method: quicksort Memory: 2,525kB
  • Buffers: shared hit=127,264
4. 19.209 154.441 ↓ 15,220.0 15,220 1

Nested Loop Left Join (cost=8.67..32.48 rows=1 width=95) (actual time=26.122..154.441 rows=15,220 loops=1)

  • Join Filter: (a.id_alarm_type = 22)
  • Rows Removed by Join Filter: 5,508
  • Buffers: shared hit=127,258
5. 8.117 120.012 ↓ 15,220.0 15,220 1

Nested Loop (cost=8.39..24.12 rows=1 width=99) (actual time=26.112..120.012 rows=15,220 loops=1)

  • Buffers: shared hit=85,787
6. 10.535 36.571 ↓ 25,108.0 25,108 1

Hash Join (cost=8.10..15.76 rows=1 width=68) (actual time=26.018..36.571 rows=25,108 loops=1)

  • Hash Cond: (b.id = a.id_alarm_type)
  • Buffers: shared hit=9,727
7. 0.042 0.042 ↑ 1.0 120 1

Seq Scan on alarm_type b (cost=0.00..7.20 rows=120 width=28) (actual time=0.003..0.042 rows=120 loops=1)

  • Buffers: shared hit=6
8. 9.348 25.994 ↓ 25,108.0 25,108 1

Hash (cost=8.09..8.09 rows=1 width=40) (actual time=25.994..25.994 rows=25,108 loops=1)

  • Buckets: 32,768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2,022kB
  • Buffers: shared hit=9,721
9. 16.646 16.646 ↓ 25,108.0 25,108 1

Index Scan using idx_alarm_history_verified_null on alarm_history a (cost=0.25..8.09 rows=1 width=40) (actual time=0.012..16.646 rows=25,108 loops=1)

  • Buffers: shared hit=9,721
10. 75.324 75.324 ↑ 1.0 1 25,108

Index Scan using pk_vehicle on vehicle c (cost=0.28..8.31 rows=1 width=39) (actual time=0.003..0.003 rows=1 loops=25,108)

  • Index Cond: (id = a.id_vehicle)
  • Filter: ((id_agron_module = 1) AND (id_company = 50))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=76,060
11. 15.220 15.220 ↑ 1.0 1 15,220

Index Scan using pk_vehicle_rule on vehicle_rule vr (cost=0.29..8.35 rows=1 width=43) (actual time=0.001..0.001 rows=1 loops=15,220)

  • Index Cond: (a.index = id)
  • Buffers: shared hit=41,471
Planning time : 1.349 ms
Execution time : 181.975 ms