explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9Uzj

Settings
# exclusive inclusive rows x rows loops node
1. 259.038 10,843.208 ↓ 28.0 294,542 1

Limit (cost=421,018.23..440,123.78 rows=10,516 width=280) (actual time=9,474.931..10,843.208 rows=294,542 loops=1)

2. 197.815 10,584.170 ↓ 28.0 294,542 1

Gather (cost=421,018.23..440,123.78 rows=10,516 width=280) (actual time=9,474.929..10,584.170 rows=294,542 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
3. 298.934 10,386.355 ↓ 21.7 73,636 4

Nested Loop Left Join (cost=420,018.23..438,072.18 rows=3,392 width=280) (actual time=9,465.148..10,386.355 rows=73,636 loops=4)

4. 81.362 10,087.419 ↓ 21.7 73,636 4

Hash Left Join (cost=420,017.80..429,209.77 rows=3,392 width=259) (actual time=9,464.990..10,087.419 rows=73,636 loops=4)

  • Hash Cond: (ii.vendor_id = v.id)
5. 297.959 10,005.443 ↓ 21.7 73,636 4

Nested Loop Left Join (cost=419,975.19..429,158.26 rows=3,392 width=257) (actual time=9,463.774..10,005.443 rows=73,636 loops=4)

6. 144.381 9,707.482 ↓ 21.7 73,636 4

Merge Left Join (cost=419,974.75..420,334.83 rows=3,392 width=225) (actual time=9,463.399..9,707.482 rows=73,636 loops=4)

  • Merge Cond: (incidents.id = alerts.incident_id)
7. 101.599 2,442.634 ↓ 21.7 73,636 4

Sort (cost=22,791.57..22,800.05 rows=3,392 width=115) (actual time=2,406.202..2,442.634 rows=73,636 loops=4)

  • Sort Key: incidents.id
  • Sort Method: quicksort Memory: 14387kB
  • Worker 0: Sort Method: quicksort Memory: 13810kB
  • Worker 1: Sort Method: quicksort Memory: 13995kB
  • Worker 2: Sort Method: quicksort Memory: 13714kB
8. 2,235.464 2,341.035 ↓ 21.7 73,636 4

Parallel Bitmap Heap Scan on incidents (cost=6,386.57..22,592.66 rows=3,392 width=115) (actual time=96.979..2,341.035 rows=73,636 loops=4)

  • 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 (service_id = 59940837))
  • Rows Removed by Index Recheck: 877102
  • Heap Blocks: lossy=27490
9. 11.131 105.571 ↓ 0.0 0 1

BitmapAnd (cost=6,386.57..6,386.57 rows=14,714 width=0) (actual time=105.570..105.571 rows=0 loops=1)

10. 33.492 33.492 ↑ 3.1 3,676,160 1

Bitmap Index Scan on incidents_created_at_idx (cost=0.00..484.99 rows=11,406,258 width=0) (actual time=33.491..33.492 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))
11. 60.948 60.948 ↓ 1.1 618,954 1

Bitmap Index Scan on incidents_service_id_idx (cost=0.00..5,896.07 rows=560,640 width=0) (actual time=60.947..60.948 rows=618,954 loops=1)

  • Index Cond: (service_id = 59940837)
12. 189.426 7,120.467 ↑ 1.1 125,627 4

Sort (cost=397,183.19..397,536.66 rows=141,390 width=110) (actual time=7,056.686..7,120.467 rows=125,627 loops=4)

  • Sort Key: alerts.incident_id
  • Sort Method: quicksort Memory: 30211kB
  • Worker 0: Sort Method: quicksort Memory: 30211kB
  • Worker 1: Sort Method: quicksort Memory: 30211kB
  • Worker 2: Sort Method: quicksort Memory: 30211kB
13. 5,689.836 6,931.041 ↑ 1.1 125,634 4

Bitmap Heap Scan on alerts (cost=64,374.33..385,087.75 rows=141,390 width=110) (actual time=1,246.475..6,931.041 rows=125,634 loops=4)

  • 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 = 27357))
  • Rows Removed by Index Recheck: 8010598
  • Filter: (suppressed <> 1)
  • Rows Removed by Filter: 73679
  • Heap Blocks: lossy=194416
14. 76.564 1,241.205 ↓ 0.0 0 4

BitmapAnd (cost=64,374.33..64,374.33 rows=299,738 width=0) (actual time=1,241.205..1,241.205 rows=0 loops=4)

15. 42.483 42.483 ↑ 2.8 4,587,520 4

Bitmap Index Scan on alerts_created_at_idx (cost=0.00..273.06 rows=12,942,071 width=0) (actual time=42.482..42.483 rows=4,587,520 loops=4)

  • 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))
16. 1,122.158 1,122.158 ↓ 1.0 6,156,874 4

Bitmap Index Scan on alerts_account_id_idx (cost=0.00..64,030.33 rows=6,088,554 width=0) (actual time=1,122.158..1,122.158 rows=6,156,874 loops=4)

  • Index Cond: (account_id = 27357)
17. 0.002 0.002 ↑ 1.0 1 294,542

Index Scan using inbound_integrations_pkey on inbound_integrations ii (cost=0.43..2.60 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=294,542)

  • Index Cond: (CASE WHEN (alerts.inbound_integration_id IS NULL) THEN incidents.inbound_integration_id ELSE alerts.inbound_integration_id END = id)
18. 0.230 0.614 ↓ 1.0 428 4

Hash (cost=37.27..37.27 rows=427 width=6) (actual time=0.614..0.614 rows=428 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
19. 0.384 0.384 ↓ 1.0 428 4

Seq Scan on vendors v (cost=0.00..37.27 rows=427 width=6) (actual time=0.036..0.384 rows=428 loops=4)

20. 0.002 0.002 ↑ 1.0 1 294,542

Index Scan using services_pkey on services s (cost=0.44..2.61 rows=1 width=33) (actual time=0.002..0.002 rows=1 loops=294,542)

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