CLC-2671 Improve performance of Oracle db queries

https://jira.media.berkeley.edu/jira/browse/CLC-2671