Use unit tests to assert and count SQL statements to ensure your code does not generate additional queries. Use this linkfor more information.

sqlcount