#24638: New feature: support adding an SQL comment in queries
-------------------------------------+-------------------------------------
Reporter: adamchainz | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: queryset, query, | Triage Stage: Accepted
comment, optimizer hint |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by adamchainz):
MSSQL - it appears all hints come in an OPTION clause after HAVING:
https://msdn.microsoft.com/en-us/library/ms189499.aspx
DB2 - it appears hints come in a %_HINTS clause after WHERE:
http://scn.sap.com/thread/1573275
So yes, unfortunately this is not general-purpose enough for adding query
hints.
I did try an implementation with the comments injected on
DeleteSQLCompiler but the cascade did lead to it pretty broken since the
query hint for delete was carried to the selects. User generated selects
only sounds good - the current patch does update too, but it's not often
you want to add hints on them anyway as there are no joins.
--
Ticket URL: <https://code.djangoproject.com/ticket/24638#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.921b7bf4ef4dd7afd0ade2468855ac91%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.