Opened 3 weeks ago

Closed 3 weeks ago

#37451 closed Cleanup/optimization (wontfix)

`QuerySet.get()` must not pull more than 2 rows with `DEBUG=False`

Reported by: Sobolev Nikita Owned by: mudassar
Component: Database layer (models, ORM) Version: 6.1
Severity: Low Keywords: queryset, orm, database
Cc: Sobolev Nikita Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Refs https://code.djangoproject.com/ticket/6785

Source:

While this is helpful for debug inforation, it can potentially slow down production requests. With fetching 19 more entries.
This can be especially slow in cases when full-scan is used.

I propose limitting this value to 2 with DEBUG=False. This keeps the best of two worlds:

  • Better debug inforation in DEBUG mode
  • Faster code in production

Change History (2)

comment:1 by mudassar, 3 weeks ago

Owner: set to mudassar
Status: new → assigned

comment:2 by Tim Graham, 3 weeks ago

Resolution: → wontfix
Status: assigned → closed
Type: Uncategorized → Cleanup/optimization

We would need some consensus on the DevelopersMailingList (now the Django forum) in order to change the original design decision. You're welcome to make a post there.

Note: See TracTickets for help on using tickets.
Back to Top