Hi Nigel, Creating a subquery only looks like a good solution for a limited number of cases. As far as I'm aware it will also change an execution plan and can cause a performance regression in complicated queries. We also cannot group by column aliases on Oracle as proposed in PR14251 <https://github.com/django/django/pull/14251>. You can try to tune cursor sharing <https://docs.oracle.com/en/database/oracle/oracle-database/19/tgsql/improving-rwp-cursor-sharing.html#GUID-971F4652-3950-4662-82DE-713DDEED317C> but I don't have any advice here. I would be happy to review a patch in this area, so feel-free to prepare an optimization.
Best, Mariusz -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ad5e58c5-9b36-4e74-92ce-ee3148e72386n%40googlegroups.com.