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

socketpair opened this Issue Oct 26, 2014 · 2 comments


None yet

2 participants


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:

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

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