Software development is very similar to people cure. Doctors treat us, do a lot of various tests 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 a way how it can be done by Doctor House. In this lecture we will be concentrated on functional part of testing. We are going to solve complex, intricate but real and very interesting case as always in Doctor House series.