explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BJSA

Settings
# exclusive inclusive rows x rows loops node
1. 1.189 159.684 ↓ 1,246.0 1,246 1

Sort (cost=32.57..32.57 rows=1 width=135) (actual time=159.345..159.684 rows=1,246 loops=1)

  • Sort Key: (max(a.triggered)) DESC
  • Sort Method: quicksort Memory: 379kB
  • Buffers: shared hit=125,665
2. 7.638 158.495 ↓ 1,246.0 1,246 1

GroupAggregate (cost=32.52..32.56 rows=1 width=135) (actual time=146.977..158.495 rows=1,246 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=125,662
3. 17.603 150.857 ↓ 14,953.0 14,953 1

Sort (cost=32.52..32.52 rows=1 width=95) (actual time=146.956..150.857 rows=14,953 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,487kB
  • Buffers: shared hit=125,662
4. 20.223 133.254 ↓ 14,953.0 14,953 1

Nested Loop Left Join (cost=8.67..32.51 rows=1 width=95) (actual time=25.504..133.254 rows=14,953 loops=1)

  • Join Filter: (a.id_alarm_type = 22)
  • Rows Removed by Join Filter: 5,404
  • Buffers: shared hit=125,659
5. 12.571 98.078 ↓ 14,953.0 14,953 1

Nested Loop (cost=8.38..24.15 rows=1 width=99) (actual time=25.494..98.078 rows=14,953 loops=1)

  • Buffers: shared hit=84,924
6. 10.730 36.239 ↓ 24,634.0 24,634 1

Hash Join (cost=8.10..15.76 rows=1 width=68) (actual time=25.470..36.239 rows=24,634 loops=1)

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

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

  • Buffers: shared hit=6
8. 9.807 25.453 ↓ 24,634.0 24,634 1

Hash (cost=8.09..8.09 rows=1 width=40) (actual time=25.452..25.453 rows=24,634 loops=1)

  • Buckets: 32,768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1,989kB
  • Buffers: shared hit=9,563
9. 15.646 15.646 ↓ 24,634.0 24,634 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.015..15.646 rows=24,634 loops=1)

  • Buffers: shared hit=9,563
10. 49.268 49.268 ↑ 1.0 1 24,634

Index Scan using pk_vehicle on vehicle c (cost=0.28..8.30 rows=1 width=39) (actual time=0.002..0.002 rows=1 loops=24,634)

  • Index Cond: (id = a.id_vehicle)
  • Filter: ((id_agron_module = 1) AND (id_company = 50))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=75,355
11. 14.953 14.953 ↑ 1.0 1 14,953

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=14,953)

  • Index Cond: (a.index = id)
  • Buffers: shared hit=40,735
Planning time : 1.350 ms
Execution time : 160.269 ms