[Glass] Queries in Gemstone ...

itlists@schrievkrom.de via Glass glass at lists.gemtalksystems.com
Sun Feb 8 10:21:53 PST 2015


Yes, I know ... but for a simple question this seems to be lots of work
and with the introduction of the new query manager in 3.2.3 I hope that
Gemstone does more work possible in this direction ...

Am 08.02.2015 um 17:46 schrieb Dale Henrichs:
> Marten,
> 
> If you were to use indexes, then you'd put an index on x.z, query on x.z
> = ??? and then sort the result set on x.q.
> 
> If the result set for x.z = ??? is very large then then the cost of
> sorting the result can outweigh the advantage of the quick initial lookup.
> 
> You could maintain a KeyValueDictionary where the keys map to the value
> of x.z and the values are sorted collections or indexed collections. Use
> an index if the x.q value is expected to change.
> 
> If the value of x.q is likely to change and you need automatic updates,
> you can arrange to use modification tracking to update the dictionary
> when x.q changes ...
> 
> Dale
> 
> 
> On 2/8/15 7:02 AM, itlists at schrievkrom.de via Glass wrote:
>> ... and I sometimes ask me, how this can be done in an efficient way in
>> Gemstone:
>>
>> select x from y ordered by x.q where x.z = .... limit n
>>
>>
>> Get thy entries from set/bag y where the attribute z of the instance has
>> the value ... and the result should be ordered via attribute q and I
>> only need the first n entries.
>>
>>
>> Marten
>>
> 


-- 
Marten Feldtmann


More information about the Glass mailing list