rails/rails — Issue #3582: ActiveRecord slow when using select(field)
Author: sradu
Created: 2011-11-09 08:19:09+00:00
State: open

Running a big query like:
ItemData.where('parent_id in ?', parents).select('item_data.id').all takes around 6000ms.

The exact same query using:
ActiveRecord::Base.connection().select_rows("SELECT id from item_data [..]") takes 600ms.

Using the mysql2 adapter.

-R.