Missing index for product alias

  • Posts: 26
  • Thank you received: 2
2 weeks 2 days ago #369857

-- HikaShop version -- : 6.1.1
-- Joomla version -- : 5.4.1
-- PHP version -- : 8.3

Assuming that routing queries DB for product alias on each product page load, the query during routing doesn't use index:

SELECT product_id
FROM jos_hikashop_product
WHERE product_alias = 'iphone-17-pro'

It's important to add index for product_alias column.
Same for category_alias in #__hikashop_category table.

Please Log in or Create an account to join the conversation.

  • Posts: 84941
  • Thank you received: 13835
  • MODERATOR
2 weeks 2 days ago #369862

Hi,

Thank you for your feedback. That sounds like a good idea. We'll be adding this.
Note that this applies only if you turn on the "Remove products and categories id in URLs" setting of the HikaShop configuration and that option is deactivated by default. When the id is in the URL, the system doesn't rely on the alias in the URL for the routing and directly uses the id so this query is not run, and it is even more efficient.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum