Do not automatically add "distinct" if query.first() used #90

Closed
socketpair opened this Issue Oct 26, 2014 · 2 comments

Projects

None yet

2 participants

@socketpair

This will probably speedup query, since SQL-engine typically apply LIMIT as the last action, not all engines are smart enough to eliminate distinct logic if only one record requested. So, Pony should be smarter. But if someone adds SKIP 42 LIMIT 1, Pony should use distinct anyway.

Original discussion: http://doc.ponyorm.com/queries.html#comment-1654734639

@kozlovsky kozlovsky closed this in 34b20d8 Oct 28, 2014
@kozlovsky
Contributor

Fixed, now Pony implicitly adds .without_distinct() before .first()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment