PERF: Don't create a Relation when it is not needed.
PERF: Don't create a Relation when it is not needed.

Benchmark script used:
```
begin
  require 'bundler/inline'
rescue LoadError => e
  $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
  raise e
end

gemfile(true) do
  source 'https://rubygems.org'
  gem 'rails', path: '~/rails' # master against ref "f1f0a3f8d99aef8aacfa81ceac3880dcac03ca06"
  gem 'arel', github: 'rails/arel', branch: 'master'
  gem 'rack', github: 'rack/rack', branch: 'master'
  gem 'sass'
  gem 'sprockets-rails', github: 'rails/sprockets-rails', branch: 'master'
  gem 'sprockets', github: 'rails/sprockets', branch: 'master'
  gem 'pg'
  gem 'benchmark-ips'
end

require 'active_record'
require 'benchmark/ips'

ActiveRecord::Base.establish_connection('postgres://postgres@localhost:5432/rubybench')

ActiveRecord::Migration.verbose = false

ActiveRecord::Schema.define do
  create_table :users, force: true do |t|
    t.string :name, :email
    t.timestamps null: false
  end
end

class User < ActiveRecord::Base; end

attributes = {
  name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  email: "foobar@email.com",
}

1000.times { User.create!(attributes) }

Benchmark.ips(5, 3) do |x|
  x.report('all') { User.all }
end

key =
  if RUBY_VERSION < '2.2'
    :total_allocated_object
  else
    :total_allocated_objects
  end

before = GC.stat[key]
User.where(name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
after = GC.stat[key]
puts "Total Allocated Object: #{after - before}"

```

Before:
```
Calculating -------------------------------------
                 all    17.569k i/100ms
-------------------------------------------------
                 all    190.854k (± 3.3%) i/s -    966.295k
Total Allocated Object: 85
```

After:
```
Calculating -------------------------------------
                 all    22.237k i/100ms
-------------------------------------------------
                 all    262.715k (± 5.5%) i/s -      1.312M
Total Allocated Object: 80
```

sergey-alekseev/rails,sergey-alekseev/rails,arunagw/rails,pvalena/rails,georgeclaghorn/rails,yasslab/railsguides.jp,jeremy/rails,ledestin/rails,flanger001/rails,travisofthenorth/rails,printercu/rails,BlakeWilliams/rails,Edouard-chin/rails,utilum/rails,eileencodes/rails,flanger001/rails,tjschuck/rails,illacceptanything/illacceptanything,yalab/rails,deraru/rails,kirs/rails-1,illacceptanything/illacceptanything,MichaelSp/rails,arjes/rails,gcourtemanche/rails,yasslab/railsguides.jp,samphilipd/rails,prathamesh-sonpatki/rails,georgeclaghorn/rails,illacceptanything/illacceptanything,Stellenticket/rails,notapatch/rails,yahonda/rails,iainbeeston/rails,mijoharas/rails,coreyward/rails,kmcphillips/rails,gauravtiwari/rails,untidy-hair/rails,brchristian/rails,repinel/rails,vipulnsward/rails,baerjam/rails,pschambacher/rails,yalab/rails,felipecvo/rails,riseshia/railsguides.kr,rails/rails,rafaelfranca/omg-rails,vipulnsward/rails,Sen-Zhang/rails,repinel/rails,bogdanvlviv/rails,matrinox/rails,tijwelch/rails,arjes/rails,assain/rails,sealocal/rails,kenta-s/rails,tjschuck/rails,utilum/rails,yahonda/rails,gauravtiwari/rails,printercu/rails,travisofthenorth/rails,kmayer/rails,starknx/rails,ngpestelos/rails,fabianoleittes/rails,schuetzm/rails,coreyward/rails,vassilevsky/rails,notapatch/rails,Envek/rails,Stellenticket/rails,betesh/rails,prathamesh-sonpatki/rails,repinel/rails,gavingmiller/rails,maicher/rails,shioyama/rails,amoody2108/TechForJustice,illacceptanything/illacceptanything,MichaelSp/rails,shioyama/rails,Edouard-chin/rails,illacceptanything/illacceptanything,bolek/rails,lucasmazza/rails,vassilevsky/rails,utilum/rails,amoody2108/TechForJustice,yawboakye/rails,sealocal/rails,ttanimichi/rails,hanystudy/rails,voray/rails,illacceptanything/illacceptanything,marklocklear/rails,brchristian/rails,tijwelch/rails,yasslab/railsguides.jp,travisofthenorth/rails,bradleypriest/rails,koic/rails,arunagw/rails,MichaelSp/rails,schuetzm/rails,schuetzm/rails,bogdanvlviv/rails,marklocklear/rails,alecspopa/rails,yawboakye/rails,palkan/rails,Erol/rails,baerjam/rails,riseshia/railsguides.kr,esparta/rails,rails/rails,printercu/rails,yawboakye/rails,yahonda/rails,yhirano55/rails,mohitnatoo/rails,esparta/rails,richseviora/rails,tjschuck/rails,mohitnatoo/rails,kmayer/rails,hanystudy/rails,mtsmfm/rails,kddeisz/rails,matrinox/rails,kirs/rails-1,Stellenticket/rails,joonyou/rails,baerjam/rails,joonyou/rails,tgxworld/rails,illacceptanything/illacceptanything,ledestin/rails,betesh/rails,riseshia/railsguides.kr,mathieujobin/reduced-rails-for-travis,MSP-Greg/rails,rbhitchcock/rails,brchristian/rails,alecspopa/rails,kmcphillips/rails,yasslab/railsguides.jp,stefanmb/rails,88rabbit/newRails,illacceptanything/illacceptanything,kmcphillips/rails,Sen-Zhang/rails,kmayer/rails,kamipo/rails,EmmaB/rails-1,deraru/rails,Envek/rails,bogdanvlviv/rails,vassilevsky/rails,lcreid/rails,tgxworld/rails,MSP-Greg/rails,Spin42/rails,assain/rails,elfassy/rails,jeremy/rails,yawboakye/rails,palkan/rails,gavingmiller/rails,georgeclaghorn/rails,Spin42/rails,felipecvo/rails,betesh/rails,xlymian/rails,starknx/rails,bogdanvlviv/rails,starknx/rails,gavingmiller/rails,yhirano55/rails,kaspth/rails,travisofthenorth/rails,tijwelch/rails,Envek/rails,pvalena/rails,matrinox/rails,kachick/rails,alecspopa/rails,gcourtemanche/rails,mijoharas/rails,mtsmfm/railstest,eileencodes/rails,Vasfed/rails,gfvcastro/rails,jeremy/rails,mathieujobin/reduced-rails-for-travis,kirs/rails-1,yalab/rails,arjes/rails,pvalena/rails,koic/rails,untidy-hair/rails,hanystudy/rails,prathamesh-sonpatki/rails,lcreid/rails,ngpestelos/rails,palkan/rails,voray/rails,jeremy/rails,flanger001/rails,bradleypriest/rails,riseshia/railsguides.kr,aditya-kapoor/rails,BlakeWilliams/rails,xlymian/rails,joonyou/rails,MSP-Greg/rails,repinel/rails,stefanmb/rails,mtsmfm/rails,lucasmazza/rails,yhirano55/rails,notapatch/rails,ngpestelos/rails,schuetzm/rails,samphilipd/rails,lucasmazza/rails,mohitnatoo/rails,deraru/rails,samphilipd/rails,rafaelfranca/omg-rails,pschambacher/rails,odedniv/rails,prathamesh-sonpatki/rails,illacceptanything/illacceptanything,esparta/rails,Stellenticket/rails,arunagw/rails,rossta/rails,vipulnsward/rails,kachick/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,mtsmfm/rails,printercu/rails,Vasfed/rails,mechanicles/rails,elfassy/rails,stefanmb/rails,pschambacher/rails,yahonda/rails,georgeclaghorn/rails,gfvcastro/rails,bolek/rails,coreyward/rails,gcourtemanche/rails,kaspth/rails,ttanimichi/rails,88rabbit/newRails,marklocklear/rails,eileencodes/rails,illacceptanything/illacceptanything,felipecvo/rails,arunagw/rails,Erol/rails,rbhitchcock/rails,bolek/rails,iainbeeston/rails,fabianoleittes/rails,joonyou/rails,mechanicles/rails,Spin42/rails,odedniv/rails,BlakeWilliams/rails,EmmaB/rails-1,iainbeeston/rails,untidy-hair/rails,yhirano55/rails,88rabbit/newRails,utilum/rails,Erol/rails,shioyama/rails,kddeisz/rails,kaspth/rails,assain/rails,Vasfed/rails,koic/rails,ttanimichi/rails,tgxworld/rails,yalab/rails,ledestin/rails,fabianoleittes/rails,assain/rails,aditya-kapoor/rails,amoody2108/TechForJustice,esparta/rails,lcreid/rails,iainbeeston/rails,illacceptanything/illacceptanything,palkan/rails,vipulnsward/rails,richseviora/rails,mohitnatoo/rails,kenta-s/rails,mtsmfm/railstest,BlakeWilliams/rails,shioyama/rails,gfvcastro/rails,pvalena/rails,kenta-s/rails,sergey-alekseev/rails,maicher/rails,kamipo/rails,kmcphillips/rails,rossta/rails,notapatch/rails,rafaelfranca/omg-rails,kddeisz/rails,sealocal/rails,Vasfed/rails,maicher/rails,tgxworld/rails,richseviora/rails,deraru/rails,mathieujobin/reduced-rails-for-travis,bradleypriest/rails,baerjam/rails,odedniv/rails,rails/rails,kachick/rails,Envek/rails,fabianoleittes/rails,Edouard-chin/rails,voray/rails,xlymian/rails,illacceptanything/illacceptanything,betesh/rails,Erol/rails,Edouard-chin/rails,illacceptanything/illacceptanything,lcreid/rails,tjschuck/rails,elfassy/rails,rails/rails,Sen-Zhang/rails,gauravtiwari/rails,mechanicles/rails,kamipo/rails,kddeisz/rails,aditya-kapoor/rails,mechanicles/rails,untidy-hair/rails,gfvcastro/rails,flanger001/rails,rossta/rails,eileencodes/rails,rbhitchcock/rails,mtsmfm/railstest,mijoharas/rails,aditya-kapoor/rails,MSP-Greg/rails,EmmaB/rails-1