db: cache prepared statements