What are some common performance bottlenecks in legacy database systems, and how do you resolve them?