Hybrid database: Dynamic selection of database infrastructure to improve query performance