activerecord-session_store icon indicating copy to clipboard operation
activerecord-session_store copied to clipboard

Retrieve session without any implicit ordering

Open dapi opened this issue 6 years ago • 3 comments

dapi avatar Apr 11 '19 10:04 dapi

Why do you want this change to be made?

rafaelfranca avatar Dec 18 '19 20:12 rafaelfranca

Because take does not require to make order in select. Order is very long operation for some kind of tables. And really we don't want to get FIRST record, just any suitable.

ActiveRecord by default first translates as 'order by id'. But type of ID record you this table may be unorderable at all (UUID for example)

https://andycroll.com/ruby/first-and-last-may-not-mean-what-you-think/

dapi avatar Dec 20 '19 11:12 dapi

Why do you want this change to be made?

In some cases default ordering is not possible and it causes an exception

dapi avatar Nov 04 '21 10:11 dapi