Feature/query constraints