Fetching millions of rows from PostgreSQL with Rails

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 https://rubyonrails.ba/single/fetching-millions-of-rows-from-postgresql-with-rails

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles