laserlight wrote:
Assuming cooperative management, doesn't it make more sense to tackle the area that will give larger performance gains first?
This has taken me so long you two have been talking 🙂
Well it is a balance between time needed to be taken and the performance gained. Once entered into the potentially murky world of the code it could turn into a bottomless well of hair pulling. Select * in these things is also a very dirty part of them, if someone has stuck an image as a blob in a field that is coming out when not needed the thing becomes an eater of worlds later.
Optimising the database, if it is known what to look for could be done in a morning and he can turn round and say he improved it x amount in a few hours/day. Doing it first also could achieve very good results right across the site and be very visible. He may be known in the future as the 'wizard'.
The engineers who write the engines have to assume that monkeys are going to write stuff and have to guard against it. If they don't guard against it with query caching etc then ultimately their database will get the blame, however good it is, and get bad press.
Once it is optimized it breaks down to 3 things
Optimise the sql of common elements that could be incurring loss across multiple pages. Fixing those will give a general performance increase that will also be pretty noticeable.
Pages that are most popular and have the most problematic performance.
Pages that are infrequently used but have real major problems still. Someone who infrequently goes to a report that appears quite complex assumes it is quite complex and assumes it will take a while.
The order the subtasks of those 3 are done is really up to instinct. Just comment stuff out and see how it affects things in a development environment, estimate how long it will take to do and keep track of very effective 1-2 hr refactorings. Then move onto half day/one day ones etc.
Each time a small thing is done well management will hopefully get more cooperative. If he puts the things that will float their boats the most at the top of each list even more so. Start off small and push management a little bit further each time.
The whole time slowing chiselling away at the current way of doing things and building a new database layer that actually has respect for the database. I am assuming it was done using an ORM thingy which could cause the most amount of problems to remove. If it is just select * and raw mysql calls then it can be done pretty quickly. Just laborious. Also check indexes as it is being done as some slip under the net as they might not be obvious.
Most people are so busy looking for attacks from the back and front it is pretty easy to sneak in from the side.
laserlight wrote:I like your style 🙂
Well as you are the one who usually contests me I quite like yours 🙂