slave: Add caches and indexes to database