Software development is very simular to people cure. Doctors treat us, do a lot of various test and we also test software and 'treat' our applications. Therefore, we can know a lot from doctors. Doctor House is probably the most famous and charismatic doctor in the world. Surely he is not real but anyway there are so many things we can learn from him. This report will be about testing query optimization in such way how it can be done by Doctor House. In this lecture we will be contcetrated on functional part of testing. We are going to solve complex, intricate but real and very interesting case as always in Doctor House series.