I am using Ruby on Rails 3.2.2 and MySQL. From the logger I know that my system is running an SQL query like the following:
SELECT `articles`.* FROM `articles` WHERE (articles IN (1,2,...,<A_LOT_OF_ID_VALUES>))
From the source code I know that the <A_LOT_OF_ID_VALUES> value growns as the number of rows / records present in the related articles database table… should I be aware of that “directly proportional growing”?
Bonus: “Practically” speaking, should I be aware of too “long” text outputs (for example, text outputs as like the previously mentioned “1,2,...,100,101,...,<A_LOT_OF_ID_VALUES>” string) in log files?
Yes you shoud be aware of growing list of ids ….. it is ok for a bit, but once you go to hundreds or thousands then the query will get really slow.
The alternate is to use a subquery that selects the ids that you require.