Skip to content

Instantly share code, notes, and snippets.

@dmitry
Created March 20, 2017 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitry/b00941bf48997bc2789c540191241241 to your computer and use it in GitHub Desktop.
Save dmitry/b00941bf48997bc2789c540191241241 to your computer and use it in GitHub Desktop.
(0..24).to_a.map do Thread.new do 0.upto(20000) do |i| ActiveRecord::Base.connection.execute("SELECT * FROM properties WHERE #{i}=#{i} LIMIT 1").to_a end end end.map(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment