Database performance has always been something of a black art consisting largely of obscure tricks. Although there's no single trick that will make your application scale, there are several tricks that can help you identify and address performance problems. This chapter covers those tricks. It also discusses some best practices to make sure you get most out of your code.