If you don't know how to organize your data for optimal execution then it doesn't matter.
You have to learn that first.
Changing this generally means a rewrite.
By the time you measure it is "too late" to do anything easy about data access.
All you can do is find terrible algorithm mistakes that were made and remove them.