explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G6wF

Settings
# exclusive inclusive rows x rows loops node
1. 0.222 1,664.031 ↑ 1.6 259 1

Limit (cost=2,062.69..7,980,224.63 rows=421 width=281) (actual time=409.250..1,664.031 rows=259 loops=1)

2. 0.525 1,663.809 ↑ 1.6 259 1

Nested Loop Left Join (cost=2,062.69..7,980,224.63 rows=421 width=281) (actual time=409.248..1,663.809 rows=259 loops=1)

3. 46.892 1,661.989 ↑ 1.6 259 1

Nested Loop Left Join (cost=2,062.26..7,979,107.97 rows=421 width=260) (actual time=408.792..1,661.989 rows=259 loops=1)

  • Join Filter: (v.id = ii.vendor_id)
  • Rows Removed by Join Filter: 110852
4. 0.497 1,569.772 ↑ 1.6 259 1

Nested Loop Left Join (cost=2,062.26..7,976,373.13 rows=421 width=258) (actual time=407.632..1,569.772 rows=259 loops=1)

5. 0.000 1,568.757 ↑ 1.6 259 1

Nested Loop Left Join (cost=2,061.82..7,975,257.53 rows=421 width=226) (actual time=407.620..1,568.757 rows=259 loops=1)

  • Join Filter: (alerts.incident_id = incidents.id)
  • Rows Removed by Join Filter: 6713
6. 0.000 1,312.514 ↑ 18.3 23 1

Gather (cost=1,487.49..7,969,200.73 rows=421 width=116) (actual time=321.161..1,312.514 rows=23 loops=1)

  • Workers Planned: 8
  • Workers Launched: 8
7. 1,585.622 1,619.122 ↑ 17.7 3 9

Parallel Bitmap Heap Scan on incidents (cost=487.49..7,968,158.63 rows=53 width=116) (actual time=322.185..1,619.122 rows=3 loops=9)

  • 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))
  • Rows Removed by Index Recheck: 616286
  • Filter: (service_id = 45918544)
  • Rows Removed by Filter: 861319
  • Heap Blocks: lossy=33152
8. 33.500 33.500 ↑ 3.2 3,676,160 1

Bitmap Index Scan on incidents_created_at_idx (cost=0.00..487.39 rows=11,782,976 width=0) (actual time=33.500..33.500 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))
9. 3.107 257.991 ↑ 2.1 303 23

Materialize (cost=574.33..2,067.30 rows=632 width=110) (actual time=3.272..11.217 rows=303 loops=23)

10. 197.366 254.884 ↑ 2.1 303 1

Bitmap Heap Scan on alerts (cost=574.33..2,064.14 rows=632 width=110) (actual time=75.245..254.884 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
11. 19.959 57.518 ↓ 0.0 0 1

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

12. 28.786 28.786 ↑ 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=28.786..28.786 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))
13. 8.773 8.773 ↓ 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=8.773..8.773 rows=61,606 loops=1)

  • Index Cond: (account_id = 257176)
14. 0.518 0.518 ↓ 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.002..0.002 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)
15. 44.713 45.325 ↓ 1.0 428 259

Materialize (cost=0.00..39.41 rows=427 width=6) (actual time=0.001..0.175 rows=428 loops=259)

16. 0.612 0.612 ↓ 1.0 428 1

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

17. 1.295 1.295 ↑ 1.0 1 259

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

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