- Posts: 31
- Thank you received: 2
Missing index for product alias
10 months 1 week ago #369857
by Denitz
Missing index for product alias was created by Denitz
-- 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.
-- 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.
10 months 1 week ago #369862
by nicolas
Replied by nicolas on topic Missing index for product alias
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.
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.041 seconds