[Glass] Where are indices really useful ?
Norm Green via Glass
glass at lists.gemtalksystems.com
Sat Jan 28 08:29:03 PST 2017
That's correct. With a low selectivity query (aka large result set),
most of the time can be spent constructing the result set. The
#selectAsStream: methods avoid this penalty.
Also Dale is working on a major overhaul of the indexing system in 3.4.
Indexing should perform better in that release.
Norm
On 1/28/2017 8:24 AM, Marten Feldtmann via Glass wrote:
>
> Ok, I read the documentation and I understand where the problem is:
>
> The query support creates a temporary container to held the result and
> then you iterate over the result container. I assume, that it takes
> time to create and maintain this result container (if the result size
> is larger). The example below can be transferred into a streamable
> query, which speed ups the query by at least a factor of 2.
>
> Marten
>
>
>> Marten Feldtmann via Glass <glass at lists.gemtalksystems.com> hat am
>> 28. Januar 2017 um 16:03 geschrieben:
>>
>> Yes, I know: indices are a world of their own. But I asked myself,
>> what can an index bring for me.
>>
>> I had an IdentitySet with around 3759515 elements. The objects
>> contained have several attributes, but I am only considering one
>> attribute for my queries via GsQuery: the attribute instances are
>> member of SmallDouble, no nil containing.
>>
>> I produced a query like:
>>
>> "(40,0 <= each.floatvalue <= 60,0)"
>>
>> and the results are around 1719852 elements (around 50 % of the total
>> numbers of elements). I do not select the returned objects I just
>> count them.
>>
>> When I define an index on this set (equalityIndex) it took around 6
>> seconds to count them all, without index creation the system get the
>> job done in 2.5 seconds. (always a warm database).
>>
>> SQLite3 takes around 0.7s without index and 0.17s with index (total
>> numbers are not useful here, but it shows that here an index is useful).
>>
>> It seems for me, that an index in Gemstone is useful, IF the number
>> of expected elements are really small .
>>
>>
>> Any comment ?
>>
>> Marten
>>
>
>> _______________________________________________ Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20170128/fbcc5095/attachment.html>
More information about the Glass
mailing list