Custom GROUP BY method. OLAP functionality.

84 views
Skip to first unread message

Mads Jensen

unread,
Apr 28, 2020, 4:27:52 AM4/28/20
to django-d...@googlegroups.com
Hello,

I started this rather messy draft (outline of how I think it could be approached), as I posted this ticket [1] some years ago.
Basically, SQL adds some modifiers to group the result set in different ways. The ticket contains some links with good examples.

In order to solve this, it seems necessary to make a method that bypasses the group by logic of Django, so expert users can
handle this themselves. Most likely, users who want to use this feature, are already more familiar with how a database works,
than Django deals with GROUP BY quite well, so the name may be poorly chosen, because seasoned
database people starting off with Django may be tempted to neglect this fact, and jump straight off to that method, not reading
the admonition.

There's already get_group_by_cols which may be considered as well. I left a flag in the draft, Query.custom_group_by but haven't
thought this through.

I think it should be manageable for me to work on getting subquery (I posted another thread 2-3 weeks ago) and a custom grouping
method introduced in Django 3.2.

[1] https://code.djangoproject.com/ticket/27646
--
Med venlig hilsen / Kind regards,
Mads Jensen

Reply all
Reply to author
Forward
0 new messages