[Skip to main content](#vessel-content)

#   Filtering by price very slow

##

- **[Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")**
- [![Gnsbud's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37991-gnsbud "View Gnsbud's Profile") Topic Author
- [ Offline](/forum/user/37991-gnsbud)

Less More

- Posts: 42
- Thank you received: 1
-
-

11 years 1 month ago [\#214980](#214980) by [Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")  *[Filtering by price very slow](/forum/45-filters-search/879416-filtering-by-price-very-slow#214980 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.13  Hello,  it seems there is a performance issue while using price filter on frontend, could you please take a look at attached screenshots, you can see there are four quite similar queries (each one is taking around 10 seconds and they are running at the same page load), could you tell me please is there any way to make them simplier/faster? These subqueries are killing my website load speed. Also while sorting by product price or product name etc. the same thing happens, but other filters are working fast (like brand or category filter), also other website pages are running quite fast - only filtering by price and 'sorting by' is running terribly slow, just like there is some issue in /administrator/components/com&#95;hikashop/classes/filter.php I guess.  Best regards, Chris")* was created by *[Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.6.13

Hello,

it seems there is a performance issue while using price filter on frontend, could you please take a look at attached screenshots, you can see there are four quite similar queries (each one is taking around 10 seconds and they are running at the same page load), could you tell me please is there any way to make them simplier/faster? These subqueries are killing my website load speed. Also while sorting by product price or product name etc. the same thing happens, but other filters are working fast (like brand or category filter), also other website pages are running quite fast - only filtering by price and 'sorting by' is running terribly slow, just like there is some issue in /administrator/components/com_hikashop/classes/filter.php I guess.

Best regards,
Chris

- [ ![1q.png](/forum/attachment/26607) ](/forum/attachment/26607 "1q.png") [ ](/forum/attachment/26607?download=1 "1q.png")
- [ ![2q.png](/forum/attachment/26608) ](/forum/attachment/26608 "2q.png") [ ](/forum/attachment/26608?download=1 "2q.png")
- [ ![3q.png](/forum/attachment/26609) ](/forum/attachment/26609 "3q.png") [ ](/forum/attachment/26609?download=1 "3q.png")
- [ ![4q.png](/forum/attachment/26610) ](/forum/attachment/26610 "4q.png") [ ](/forum/attachment/26610?download=1 "4q.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3OTQxNi1maWx0ZXJpbmctYnktcHJpY2UtdmVyeS1zbG93P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 1 month ago [\#215095](#215095) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Filtering by price very slow](/forum/45-filters-search/879416-filtering-by-price-very-slow#215095 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.13  Hello,  it seems there is a performance issue while using price filter on frontend, could you please take a look at attached screenshots, you can see there are four quite similar queries (each one is taking around 10 seconds and they are running at the same page load), could you tell me please is there any way to make them simplier/faster? These subqueries are killing my website load speed. Also while sorting by product price or product name etc. the same thing happens, but other filters are working fast (like brand or category filter), also other website pages are running quite fast - only filtering by price and 'sorting by' is running terribly slow, just like there is some issue in /administrator/components/com&#95;hikashop/classes/filter.php I guess.  Best regards, Chris")*

Hi,

Filtering/ordering by price is indeed a lot slower than other filtering.
That's because there is a lot of calculation necessary to have a filtering which works not too bad:
- when you have several currencies, the product prices can be in some currencies only, and the system converts them automatically, so the prices of all the products on the listing have to be converted (when necessary) to the current currency.
- Filtering has to be done based on the user group of the user to only use relevant prices
- prices can have taxes applied to them and thus, again, the price with tax has to be calculated dynamically for all the products of the listing.
- prices might not be directly in the main product, but only in the variants of the products, so that also has to be taken into account.

Because of all this, the queries to handle the price filtering/ordering get very slow. Of course, you can simplify them in the /administrator/components/com_hikashop/classes/filter.php file. If you're a developer it shouldn't be a problem.
But a simpler solution is to just create a custom field of the table "product" and enter the price you want the order/filter to be based on for each product in that custom field. Then, you'll be able to base your filter on that custom product field and it will be really fast.
To make it simple to setup, you can configure a mass action via the menu System&gt;Mass actions to automatically populate your custom product field with an operation {price.price_value} in an action "update the values" of your mass action.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3OTQxNi1maWx0ZXJpbmctYnktcHJpY2UtdmVyeS1zbG93P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")**
- [![Gnsbud's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37991-gnsbud "View Gnsbud's Profile") Topic Author
- [ Offline](/forum/user/37991-gnsbud)

Less More

- Posts: 42
- Thank you received: 1
-
-

11 years 1 month ago [\#215113](#215113) by [Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")  Replied by *[Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")* on topic *[Filtering by price very slow](/forum/45-filters-search/879416-filtering-by-price-very-slow#215113 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.13  Hello,  it seems there is a performance issue while using price filter on frontend, could you please take a look at attached screenshots, you can see there are four quite similar queries (each one is taking around 10 seconds and they are running at the same page load), could you tell me please is there any way to make them simplier/faster? These subqueries are killing my website load speed. Also while sorting by product price or product name etc. the same thing happens, but other filters are working fast (like brand or category filter), also other website pages are running quite fast - only filtering by price and 'sorting by' is running terribly slow, just like there is some issue in /administrator/components/com&#95;hikashop/classes/filter.php I guess.  Best regards, Chris")*

Hi,

I did it using custom field and mass action as you suggested and it's working great. Thanks a lot!

Best regards,
Chris

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3OTQxNi1maWx0ZXJpbmctYnktcHJpY2UtdmVyeS1zbG93P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.058 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
