aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-11-07 00:27:50 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-11-09 18:47:39 +0900
commit2bf7c30049558c2503f20e9810fdf4727650fe99 (patch)
tree27f7aebb843c001060d6d1b39bd97d443f23ef43 /railties/lib/rails
parent1b16e4c348055e9e7909e59e47dbe346b149ba52 (diff)
downloadrails-2bf7c30049558c2503f20e9810fdf4727650fe99.tar.gz
rails-2bf7c30049558c2503f20e9810fdf4727650fe99.tar.bz2
rails-2bf7c30049558c2503f20e9810fdf4727650fe99.zip
Should except `:distinct` rather than `:order` for `exists?`
Records fetching order is very important for performance if `limit` is presented. Should not except the order in the case. And `exists?` replaces select list to `1 AS one` therefore `:distinct` is useless (`DISTINCT 1 AS one`). And PostgreSQL raises the following error if `:distinct` and `:order` are used in the same time. ``` ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list ```
Diffstat (limited to 'railties/lib/rails')
0 files changed, 0 insertions, 0 deletions