Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default sort on ID a bad idea if ID is a UUID #174

Open
davidw opened this issue Apr 2, 2014 · 1 comment
Open

Default sort on ID a bad idea if ID is a UUID #174

davidw opened this issue Apr 2, 2014 · 1 comment

Comments

@davidw
Copy link
Contributor

davidw commented Apr 2, 2014

Given

boss_db:find(fixation_target, []). 

The query generated is:

12:06:46.827 [info] QUERY: SELECT * FROM fixation_targets WHERE  TRUE ORDER BY id ASC PARAMS []

Which seems like a bad idea as it is wasting time sorting UUID id's.

@davidw
Copy link
Contributor Author

davidw commented Apr 2, 2014

Here's a hacky way to get around that on Postgres:

boss_db:find(fixation_target, [], [{order_by, 'true'}])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant