Ask me questions directly and I can answer them.
The code creates a set of query specs from a filter -- i.e. if the filter specifies an author and a kind, we return one spec for traversing the 'pubkeyKind' index at the specified key range, if the filter specifies 4 authors and 2 kinds, then we return 8 specs for traversing the 'pubkeyKind' index in all these different combinations.
Then we gather all the results in a heap and take them in sorted order and return them through the channel.
The heap part can probably be improved, let me know if you have something better. Maybe sacrifice a little bit of strict ordering to get some performance?