[Glass] How can I use BtreePlus with optimizedComparisons on identity indexes?

Mariano Martinez Peck via Glass glass at lists.gemtalksystems.com
Fri Dec 8 15:19:34 PST 2017

On Fri, Dec 8, 2017 at 6:20 PM, Dale Henrichs via Glass <
glass at lists.gemtalksystems.com> wrote:

> On 12/8/17 9:59 AM, Mariano Martinez Peck via Glass wrote:
>> Hi guys,
>> I carefully read the manual but I still don't understand how can I use
>> the new  BtreePlus with optimizedComparisons  for identity indexes. All the
>> examples and documentation talks about equality indexes and rely on
>> lastElementClass... which are not required for identity indexes.
> If this is an upgraded db,then you must explicitly create an index with
> optimizedComparisons set:
Hi Dale,

Yes, this was an upgraded DB.

>   | nsc |
>   nsc := Bag new.
>   GsIndexSpec new
>     identityIndex: 'value' options: GsIndexOptions btreePlusIndex +
> GsIndexOptions optimizedComparison;
>     createIndexesOn: nsc.
>   nsc

Thanks. This worked nicely.
I guess my missing part was `options: GsIndexOptions btreePlusIndex +
GsIndexOptions optimizedComparison;`

>> I tried re-creating the indexes as I was doing before, but I am still
>> getting the legacy ones.
> When you upgrade, optimizedComparison is not made a default index option
> ... I thought there should be instructions in the release notes for
> changing the default index option ... although when you first start
> exploring the new indexes you should leave the default index options alone
> and simply create indexes explicitly setting the index options you want ...

Yeah, makes sense. In any case, for myself, I am being explicit with the
options now.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20171208/5dea1949/attachment.html>

More information about the Glass mailing list