The SODA processing runs in two stages.
First SODA tries to find the best fitting index for the query. It looks up all available field- and class-indexes. Then it goes through all possible indexes and chooses the index with the smallest candidate result set.
In practice this means that SODA first uses the field-indexes. If no suitable field index is found it falls back to the class-index, which contains all objects of a certain type.
With this index a first set of candidates is created. This means SODA looks up in the index the objects and returns the IDs of the candidate-objects.
The second stage uses the ids from the first stage and runs all those objects against the given constrains. If the constrains are regular SODA-constrains, it directly uses the values in the database to compare it. If additional evaluations are present, SODA will instantiate the candidate-objects and pass it to the evaluation-function.
Finally SODA will apply the sorting and then return all IDs of objects which match the query criteria.