#4. Added indexes to tables and caching to query