Opened 23 months ago

Last modified 5 months ago

#26001 new Cleanup/optimization

Make ModelAdmin.search_fields do an integer lookup for IntegerFields

Reported by: Tim Graham Owned by:
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Currently, all queries are done as string lookups which gives something like this on PostgreSQL, for example: ("admin_views_pluggablesearchperson"."age"::text) = UPPER(20)). It would be more efficient if the admin cast the search value to an integer and used that for the query.

Change History (7)

comment:1 Changed 21 months ago by Akshesh Doshi

Owner: changed from nobody to Akshesh Doshi
Status: newassigned

comment:2 Changed 21 months ago by Akshesh Doshi

Has patch: set

comment:3 Changed 21 months ago by Simon Charette

I think we should favor the approach suggested in #26184 instead.

comment:4 Changed 21 months ago by Tim Graham

Patch needs improvement: set

I agree, let's revisit this if it doesn't.

comment:5 Changed 17 months ago by Akshesh Doshi

Owner: Akshesh Doshi deleted
Status: assignednew

comment:6 Changed 5 months ago by Krzysztof Nazarewski

Owner: set to Krzysztof Nazarewski
Status: newassigned

comment:7 Changed 5 months ago by Krzysztof Nazarewski

Owner: Krzysztof Nazarewski deleted
Status: assignednew

Related to #26184

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