Added job query DDL
Added query caching for analyses.