This is a list of benchmarks done as experiments to determine whether or not to change certain pieces of code.
WHERE IN(...) vs
Parameters: Retrieve root nodes with 50 descendants 1000 times.
|Execution time (real)||0.010050||0.015138|
I've run this several times and
WHERE IN (...) is faster each time. However, it doesn't create the row objects like
find_by_sql does, and it only retrieves the ID of each row, which essentially causes another trip to the database when you go to use the data. I'm not very concerned as I'd rather have functionality that can be optimized later instead of what I have now, which causes a lot of hackiness in order to retrieve other columns in other places in the code.