Answer the question
In order to leave comments, you need to log in
Why is a query being slow in Django?
There is a request like this:
pcollections = PCollection.objects.filter(
product__category__title__in = filter_items_active['categories_get'] ,
product__color__title__in = filter_items_active['colors_get'] ,
product__surface__title__in = filter_items_active['surfaces_get'] ,
product__width_height__title__in = filter_items_active['width_heights_get'] ,
product__price_type__title__in = filter_items_active['pricetypes_get'] ,
fabrika__title__in = filter_items_active['fabriks_get'] ,
product__appointment__title__in = filter_items_active['appointments_get'] ,
product__premises__title__in = filter_items_active['premises_get'] ,
fabrika__country__title__in = filter_items_active['countrys_get'] ,
product__picture__title__in = filter_items_active['pictures_get'] ,
product__form__title__in = filter_items_active['forms_get'] ,
product__rectificate__in = filter_items_active['rectificate_get'] ,
product__stock__in = filter_items_active['stock_get']
).distinct()
Answer the question
In order to leave comments, you need to log in
sportik174 Well, here it's worth starting with the fact that you are searching for a string, I guess that there are no indexes on the title.
In short, you shouldn't do this.
product__category__title__in = filter_items_active['categories_get']
product__category_id__in = filter_items_active['categories_get']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question