asymertical behavior with where: and where:sortedBy:...
Brent Pinkney
brent at zamail.co.za
Fri Apr 4 16:43:33 UTC 2008
On Vrydag, 04 April 2008, Hilaire Fernandes wrote:
> I found an asymmetrical behaviour in recurrent use
> where:distinct:sortedBy:descending: compare to the use of recurrent where:
>
> I get use to take a MagmaCollection and extract from it a small subset
> in a reader. Then I get the reader passed from one object to another one
> and eventually refined it with another where: message.
>
> Being able to apply recursively where: query from one initial collection
> is very very handy.
>
> As long as you do that with where: it is fined. You can repeat over and
> over where query with the same indexes of the initial collection.
> However when applying with where:distinct:sortedBy:descending: then
> indexes of the initial collection are lost (expect the one used for the
> sort). It happens because the sort create a new MagmaCollection
>
> I enclosed there a small fix. I expect it slows down a bit the sort
> because of the recreated indexes in the new collection.
> In the other hand, asymmetrical behaviour is not great at all.
> May be we should have a fast sort (what we have now) and slower sort but
> with the expected behaviour.
> I am curious to read what Chris think about the issue.
I would like to see an option to enable or enable your enhancement.
Speed is IMHO more often more useful than resursive behaviour, so I would vote to have your patch disabled by default.
More information about the Magma
mailing list