Jump to content

Why PS1.7 accesses Address table on the Order Checkout Page?


Darussalam

Recommended Posts

The initial checkout order page for guests takes over a minute to load: https://prnt.sc/190vvc8 - while if a user is logged in or bypasses the Personal Information it loads fine. When I turned on Debug Profiling I found out that it is accessing the database with 84000+ queries a printout of which I have attached. I finally figured out that the issue was caused by Address MySQL table which was imported from the live site (102k addresses before cleaning). Once I truncated the table the checkout went back to normal. Why does Prestashop need to check the address table on the initial checkout page?

Any help will be appreciated!

This initial query took 24.53 seconds:

SELECT SQL_NO_CACHE DISTINCT a.*, cl.`name`AS country, s.name AS state, s.iso_code AS
state_iso FROM `address` a LEFT JOIN `country` c ON (a.`id_country` = c.`id_country`)
LEFT JOIN `country_lang` cl ON (c.`id_country` = cl.`id_country`)
LEFT JOIN `state` s ON (s.`id_state` = a.`id_state`)
INNER JOIN country_shop country_shop ON (country_shop.id_country = c.id_country AND country_shop.id_shop = 1)
WHERE `id_lang` = 1 AND `id_customer` = 0 AND a.`deleted` = 0

SELECT SQL_NO_CACHE c.`need_identification_number` FROM `country` c WHERE c.`id_country` = 21 LIMIT 1

This keeps going on and on for 80+ pages each taking 25ms:
SELECT SQL_NO_CACHE * FROM `address` a WHERE (a.`id_address` = 38925) LIMIT 1

21-07-05-CheckoutPage-Debug.pdf

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...