← Back to context

Comment by codesnik

1 day ago

activerecord in Rails has async mode, which allows you to queue several requests and read results later. But those will go through the connection pool, and will be executed in separate connections, separate transactions, and separate PostgreSQL server processes. I wonder if using pipelining instead, on a driver level (app code would be the same), would be a better approach in general, or at least easier on db instance.

ah, of course it have been discussed already https://discuss.rubyonrails.org/t/proposal-adding-postgres-p...

  • Yes, the need isn't exactly the same. `load_async` use case if for known slow-ish queries, hence for which you want actual parallelization on the server.

    Since that discussion on the forum, I talked more about pipelining with some other core devs, and that may happen in some form or another in the future.

    The main limiting factor is that most of the big Rails contributors work with MySQL, not Postgres, and MySQL doesn't really have proper pipelining support.