puzzleatwork Posted February 4, 2016 Share Posted February 4, 2016 In trying to optimize SQL queries as much as possible I made an interesting discovery. SELECT p.* FROM `ps_product` p ... took on my setup 38.5sec! SELECT pppppp.* FROM `ps_product` pppppp ... took on my setup ~3sec. Default prefix is ps_ when setting up a new Prestashop platform. I was just informed by current hosting provider that since prefix starts with 'p' and your alias is 'p' then MySQL has to run through all ~250 tables before its locating ps_product before it can present back data requested. Can someone confirm this? If this is the case shouldn't default prefix during installation be recommended to something else not starting with p since the whole codebase utilizes alias 'p' in all queries referring to ps_product? Thanks! Link to comment Share on other sites More sharing options...
Daresh Posted February 5, 2016 Share Posted February 5, 2016 I see no differences on my setup. How many times have you repeated the tests? Link to comment Share on other sites More sharing options...
Simonas Invertus Posted February 5, 2016 Share Posted February 5, 2016 Your post does not make any sense. The name (unless it is restricted word) should not change performance in any way. If you want to optimize instead of * list the names of fields you want to select this should boost the performance. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now