Re: [Django] #35300: Simple COUNT without OUTER JOIN

2024-03-14 Thread Django
#35300: Simple COUNT without OUTER JOIN
-+-
 Reporter:  Chrea Chanchhunneng  |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Uncategorized|  Version:  4.2
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  reduce counting  | Triage Stage:
  time,  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * resolution:   => invalid
 * status:  new => closed

Comment:

 Thanks for the ticket, however I'm not sure what do you want to "count"
 and how do you expect to count related objects without `JOIN`s. You could
 probably use `.aggregate(Count(..))` in a subquery but it's hard to tell
 without a concrete example. Please first ask on the
 [https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
 support channels (Trac is not one of them) where folks will be eager to
 help.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e3be32a86-516982af-ad4a-4555-877f-733d409dbc67-00%40eu-central-1.amazonses.com.


[Django] #35300: Simple COUNT without OUTER JOIN

2024-03-13 Thread Django
#35300: Simple COUNT without OUTER JOIN
-+-
   Reporter:  Chrea  |  Owner:  nobody
  Chanchhunneng  |
   Type:  New| Status:  new
  feature|
  Component: |Version:  4.2
  Uncategorized  |   Keywords:  reduce counting
   Severity:  Normal |  time,
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 as in django query, we support `Count() in db.model` and
 `queryset.count()`. But the problem are `Count()` creates the `LEFT OUTER
 JOIN` and `queryset.count()` does not support `OuterRef("pk")`.

 I hope there is a way to just simply count without `LEFT OUTER JOIN` to
 reduce the query time.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e3b87e7e5-60ce5273-7741-4860-badb-0a667dbd9180-00%40eu-central-1.amazonses.com.