Sample code used for optimizing MySQL code