Recently I found out that distinct() can not be called on queries that
are ordered as the result query is kind of

SELECT DISTINCT table.id, table.ordering_column FROM table ORDER BY
table.ordering_column ASC

In ticket http://code.djangoproject.com/ticket/11568 was said that
this will not be fixed, bacuse this is intentional behaviour of
ordering.


So code

SomeModel.objects.order_by('ordering_column').values_list('pk')

leads to SQL

SELECT table.id, table.ordering_column FROM table ORDER BY
table.ordering_column ASC

instaed of simple

SELECT table.id FROM table ORDER BY table.ordering_column ASC

My question is, what is the intention? I could not find out any
advantage that comes from this kind of query.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to