Skip to content

Instantly share code, notes, and snippets.

@petyosi
Created April 8, 2011 08:44
Show Gist options
  • Save petyosi/909506 to your computer and use it in GitHub Desktop.
Save petyosi/909506 to your computer and use it in GitHub Desktop.
A.count # ~ 2000
# in 3.0.4 this was very fast, although loading 2000k records - they had only one field loaded anyway.
# but in 3.0.6 this jumped from 1k ms to 15k ms.
A.includes(:b => :c).where('c.active').select('distinct field').map(&:field)
# fixed with something like that
A.joins(:b => :c).where('c.active').select('distinct field').map(&:field)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment