On Mon, Mar 10, 2014 at 7:22 PM, Matthieu Rigal
<matt.ri...@googlemail.com>wrote:

> Is it somehow planned that Django Users can dialog with him to express
> some desires ?
>
> For example, I would be very happy to see a reimplementation of the
> annotate and aggregate functions, as they make the queries so slow by
> grouping by all the fields that I always have to use raw SQL to group only
> by id.
>
> In one case in my admin, it is trying to group by 40 fields (I have 5
> foreign keys and more than 20 fields) instead of 4 IDs and it requires 6
> seconds instead of 160 ms...
>

Again, I can't speak for Marc; once the Kickstarter has finalised, I'm sure
he'll be in contact with backers to describe the process he'll take. I'd be
guessing it's either going to be through his blog, or through
django-developers (and possibly both, depending on the level of interaction
you're looking for).

That said, the issue you describe sounds like it's outside the scope of
what he's looking at. The annotate query you describe may be sub-optimal,
but it does *work*. Marc's project is looking at adding the features that
PostgreSQL has, but aren't currently accessible using Django's core feature
set. This means new field types, new index types, and so on. This is all
possible by making a concerted effort to use the features Django already
provides, like custom fields and custom lookups.

What you've described is a specific SQL query optimization that presumably
would have applicability across multiple database backends. If you've got a
proposal for what this would look like at an API level, feel free to
propose it. However, keep in mind that Django's ORM is very deliberately
*not* a SQL generation engine. There are very few "SQL" concepts at the API
level, and discussing "grouping" clauses is very much in that space. You
may find that the answer to your question is "use raw SQL".

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84_hkv9AAXg-b%2BC1usw-6F%3DW22SkfasMyv4jH9Se%2BwAu7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to