Fetching millions of rows from PostgreSQL with Rails
25-Jul-2019 1697
This SQL query might take anything from some milliseconds to a couple of seconds on a regular sized application. But what if you have millions of users, and each of them have millions of posts and each post has lots of data? This is where that simple query might fail: the DB will try to process and return all the results at once, which may overload the connection, the DB machine and even your own Rails console.You could try to paginate the query with something like.
Fetching millions of rows from PostgreSQL with Rails #ruby #rubydeveloper #rubyonrails #Fetching #millions #PostgreSQL #Rails https://rubyonrails.ba/link/fetching-millions-of-rows-from-postgresql-with-rails