There isn't one simple way to optimize databases. You need understanding of the structure of your database, as well as how it's laid out, what kind of platform it runs on, how much load is placed on it, and many other factors. This is one of those cases where hiring a database administrator (DBA) would be the most appropriate action.
Simply put, though, more memory is good. Your memory size should be such that at least all of the indicies of the database could stay loaded in memory.
|