explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zcQN

Settings
# exclusive inclusive rows x rows loops node
1. 0.232 1,825.335 ↑ 1.6 259 1

Limit (cost=2,006.55..5,725.20 rows=420 width=281) (actual time=296.456..1,825.335 rows=259 loops=1)

2. 0.553 1,825.103 ↑ 1.6 259 1

Nested Loop Left Join (cost=2,006.55..5,725.20 rows=420 width=281) (actual time=296.454..1,825.103 rows=259 loops=1)

3. 0.282 1,823.514 ↑ 1.6 259 1

Hash Left Join (cost=2,006.11..4,611.20 rows=420 width=260) (actual time=296.062..1,823.514 rows=259 loops=1)

  • Hash Cond: (ii.vendor_id = v.id)
4. 0.600 1,821.721 ↑ 1.6 259 1

Nested Loop Left Join (cost=1,963.50..4,567.49 rows=420 width=258) (actual time=294.541..1,821.721 rows=259 loops=1)

5. 0.471 1,818.013 ↑ 1.6 259 1

Hash Right Join (cost=1,963.07..3,454.54 rows=420 width=226) (actual time=294.529..1,818.013 rows=259 loops=1)

  • Hash Cond: (alerts.incident_id = incidents.id)
6. 1,706.799 1,766.150 ↑ 2.1 303 1

Bitmap Heap Scan on alerts (cost=574.33..2,064.14 rows=632 width=110) (actual time=210.898..1,766.150 rows=303 loops=1)

  • Recheck Cond: ((created_at >= '2018-11-14 00:00:00'::timestamp without time zone) AND (created_at <= '2018-11-28 00:00:00'::timestamp without time zone) AND (account_id = 257176))
  • Rows Removed by Index Recheck: 191975
  • Filter: (suppressed <> 1)
  • Rows Removed by Filter: 2264
  • Heap Blocks: lossy=4467
7. 20.400 59.351 ↓ 0.0 0 1

BitmapAnd (cost=574.33..574.33 rows=1,332 width=0) (actual time=59.350..59.351 rows=0 loops=1)

8. 29.689 29.689 ↑ 2.6 4,587,520 1

Bitmap Index Scan on alerts_created_at_idx (cost=0.00..268.62 rows=12,134,032 width=0) (actual time=29.688..29.689 rows=4,587,520 loops=1)

  • Index Cond: ((created_at >= '2018-11-14 00:00:00'::timestamp without time zone) AND (created_at <= '2018-11-28 00:00:00'::timestamp without time zone))
9. 9.262 9.262 ↓ 2.1 61,606 1

Bitmap Index Scan on alerts_account_id_idx (cost=0.00..305.14 rows=28,876 width=0) (actual time=9.262..9.262 rows=61,606 loops=1)

  • Index Cond: (account_id = 257176)
10. 0.032 51.392 ↑ 18.3 23 1

Hash (cost=1,383.49..1,383.49 rows=420 width=116) (actual time=51.391..51.392 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
11. 16.406 51.360 ↑ 18.3 23 1

Bitmap Heap Scan on incidents (cost=720.12..1,383.49 rows=420 width=116) (actual time=36.688..51.360 rows=23 loops=1)

  • Recheck Cond: ((service_id = 45918544) AND (created_at >= '2018-11-14 00:00:00'::timestamp without time zone) AND (created_at <= '2018-11-28 00:00:00'::timestamp without time zone))
  • Rows Removed by Index Recheck: 69
  • Heap Blocks: exact=64
12. 0.057 34.954 ↓ 0.0 0 1

BitmapAnd (cost=720.12..720.12 rows=594 width=0) (actual time=34.954..34.954 rows=0 loops=1)

13. 0.687 0.687 ↑ 15.1 1,457 1

Bitmap Index Scan on incidents_service_id_idx (cost=0.00..232.27 rows=21,947 width=0) (actual time=0.687..0.687 rows=1,457 loops=1)

  • Index Cond: (service_id = 45918544)
14. 34.210 34.210 ↑ 3.2 3,676,160 1

Bitmap Index Scan on incidents_created_at_idx (cost=0.00..487.39 rows=11,764,762 width=0) (actual time=34.210..34.210 rows=3,676,160 loops=1)

  • Index Cond: ((created_at >= '2018-11-14 00:00:00'::timestamp without time zone) AND (created_at <= '2018-11-28 00:00:00'::timestamp without time zone))
15. 3.108 3.108 ↓ 0.0 0 259

Index Scan using inbound_integrations_pkey on inbound_integrations ii (cost=0.43..2.65 rows=1 width=44) (actual time=0.012..0.012 rows=0 loops=259)

  • Index Cond: (CASE WHEN (alerts.inbound_integration_id IS NULL) THEN incidents.inbound_integration_id ELSE alerts.inbound_integration_id END = id)
16. 0.212 1.511 ↓ 1.0 428 1

Hash (cost=37.27..37.27 rows=427 width=6) (actual time=1.510..1.511 rows=428 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
17. 1.299 1.299 ↓ 1.0 428 1

Seq Scan on vendors v (cost=0.00..37.27 rows=427 width=6) (actual time=0.007..1.299 rows=428 loops=1)

18. 1.036 1.036 ↑ 1.0 1 259

Index Scan using services_pkey on services s (cost=0.44..2.65 rows=1 width=33) (actual time=0.004..0.004 rows=1 loops=259)

  • Index Cond: (CASE WHEN (incidents.service_id IS NULL) THEN ii.service_id ELSE incidents.service_id END = id)