---
title: Use Async Query Loading for slow interactions
impact: MEDIUM
impactDescription: Improve web performance by loading database data concurrently with view rendering.
tags: rails, performance, active-record, async
---

## Use Async Query Loading for slow interactions

Improve web performance by loading database data concurrently with view rendering. Use `.load_async` on ActiveRecord relations when multiple independent queries can be executed in the background while the controller or view processes.

**Incorrect:**

```ruby
# Sequential execution (Sync)
@posts = Post.all.load
@users = User.all.load
```

**Correct:**

```ruby
# Parallel execution (Async)
@posts = Post.all.load_async
@users = User.all.load_async
```

**Tools:** Manual Review
---
