Added query for analytics preparation
Merge branch 'feature/analytics/optim' into develop