#what is faster, or no difference?

4 messages · Page 1 of 1 (latest)

worldly oak
#

given that all car models are stored in upper case in the database (postgres)
input may contain small letters (Ford vs FORD)

Car.object.filter(model=model)

or

model = kwargs["modelname"]
Car.object.filter(model__iexact=model)
deft parcel
#

when in doubt, use the SQL command EXPLAIN

#

but = usually performs better then LIKE (contains) or ILIKE(iexact or icontains)

limber elk