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

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Mon Dec 11 10:13:10 PST 2017



On 12/8/17 3:19 PM, Mariano Martinez Peck wrote:
>
> On Fri, Dec 8, 2017 at 6:20 PM, Dale Henrichs via Glass 
> <glass at lists.gemtalksystems.com 
> <mailto: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.
>
This is a good approach for "legacy" applications ... for indexing we 
did not want anyone to have the indexing system switched out from under 
them after an upgrade so we change the default index options to match 
those of the system being upgraded from ... a virgin database for 3.4 
will use the btreeplus indexes by default ... moving forward, we will 
like continue to follow this pattern ...

Dale
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20171211/270073b9/attachment.html>


More information about the Glass mailing list