Here's a few guidelines for building efficient EventQ Reporting API queries.
Unlike a SQL query, which connects separate tables together to form a result, the EventQ Reporting API starts with the full set of all activities, and is cut down to the size of the result by successively applying query restrictions. This difference makes query optimization quite different between SQL and NoSQL.
:before , type : :time :after , type : :time :restrict_to , type : :choice , choices : %w(builds commits reviews work_items custom) :in_source , type : :json :in_repository , type : :string :in_project , type : :json
:associated_to , type : :json :tagged_as , type : :json :offset , type : :integer
:associations :field_contains , type : :json :sort_by , type : :json :has_any , type : :string :has_none , type : :string
:limit , type : :integer :timeseries , type : :duration :group_by_field , type : :string :fields , type : :json :count
:in_project ["proj1211"] after 14.days.ago restrict_to commits field_contains ["settled",[true]] has_any "reviews"
Limit: The limit command is best used at the end of the set. Using it before the end can result in more than the limit of items being returned at the end of the query.
Tagged_as: Is specifically for custom activities.