Ask A Question


You’re not receiving notifications from this thread.

Parallel ActiveRecord Queries with load_async in Rails 7 Discussion

Are there any downsides to using load_async on everything if we know for a fact that we’ll be using the data during the request? It seems like a no-brainer if we can keep db connections in check?


It depends on how many threads you can handle on your system. So I would imagine there is probably an upper limit. They addressed this in the PR

Basically, having it as default might lead to unintentional consequences. Whereas, using it for queries that are exceptionally long might be the best fit for it.


it looks like the async queries saved time on the front end ..... but didn't that cost get paid on the backend? I'm unclear where the savings comes from ? And, are these queries cached in some way such that ensuing requests that contain those same queries would absolutely be faster?

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,038+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.