paint-brush
ActiveRecord on MySQL— Iterating over large tables with conditionsby@rajagopals
3,382 reads
3,382 reads

ActiveRecord on MySQL— Iterating over large tables with conditions

by Rajagopal Sathyamurthi6mNovember 24th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In this article, I’m going to demonstrate performance differences between two ways of iterating over the records in a MySQL database table with millions of records. In a high volume analytics system, tables with millions of records are quite common and iterating over the full table or a subset of these tables becomes often necessary — whether it’s to perform computations, run a migration, or create parallelized background jobs on the records. At <a href="https://www.airpr.com/" target="_blank">AirPR</a>, we have many database tables with 100s of millions of records, and it becomes important to write efficient code for iterations because there is often an order of magnitude difference between a good and not-so-good approach.

Company Mentioned

Mention Thumbnail
featured image - ActiveRecord on MySQL— Iterating over large tables with conditions
Rajagopal Sathyamurthi HackerNoon profile picture
Rajagopal Sathyamurthi

Rajagopal Sathyamurthi

@rajagopals

L O A D I N G
. . . comments & more!

About Author

Rajagopal Sathyamurthi HackerNoon profile picture
Rajagopal Sathyamurthi@rajagopals

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Bitcoininsider
Jakartadev