The Titan documentation says that:
Mixed indexes support ordering natively and efficiently. However, the property key used in the order().by() method must
You must supply a value to filter on for the indices to be used. Here:
g.V().order().by('prop1', incr)
you don't provide any filter, so Titan has to iterate all of V()
and then applies the sort.
Here:
g.V().has('prop1').count()
you supply a indexed key but don't specify a value to filter on so it's still iterating all of V()
. You could do:
g.V().has("prop1", textRegex(".*")).count()
In this case, you would fake Titan out a bit, but the query still could be slow anyway if that query returns a lot of results to iterate over.