fix #4. added indexes to tables and caching to query
Merge pull request #11 from intaro/issue-4

#4. Added indexes to tables and caching to query