[Glass] There is really no way to have an ordered/sorted collection together with indexes?
Martin McClure via Glass
glass at lists.gemtalksystems.com
Thu Aug 10 17:19:28 PDT 2017
On 08/09/2017 07:19 AM, Mariano Martinez Peck via Glass wrote:
> For my particular case, I finally decided to keep both collection... a
> SortedCollection for getting "last price" and "all price history
> sorted" very fast, and a "Bag with indexes" for querying prices for a
> given date or closest to it (using both queries as suggested by
> Dale...with the reversedReadStream and even caching the parsed query
> etc) . Of course, it made my code a little bit more complex and make
> the extent grow some more. But it's worth as I need both scenarios to
> be fast.
>
Hi Mariano,
To keep the code complexity contained, you can create your own class,
each instance of which contains the two collections, and implement
whatever nice application-specific query and update methods you need in
that class.
Regards,
-Martin
More information about the Glass
mailing list