How can I use BtreePlus with optimizedComparisons on identity indexes?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I use BtreePlus with optimizedComparisons on identity indexes?

GLASS mailing list
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. 

I tried re-creating the indexes as I was doing before, but I am still getting the legacy ones. 

Any idea? 

Thanks in advance,

--

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How can I use BtreePlus with optimizedComparisons on identity indexes?

GLASS mailing list


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:

   | nsc |
   nsc := Bag new.
   GsIndexSpec new
     identityIndex: 'value' options: GsIndexOptions btreePlusIndex +
GsIndexOptions optimizedComparison;
     createIndexesOn: nsc.
   nsc
>
> 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 ...

Dale
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How can I use BtreePlus with optimizedComparisons on identity indexes?

GLASS mailing list

On Fri, Dec 8, 2017 at 6:20 PM, Dale Henrichs via Glass <[hidden email]> 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. 


--

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How can I use BtreePlus with optimizedComparisons on identity indexes?

GLASS mailing list



On 12/8/17 3:19 PM, Mariano Martinez Peck wrote:

On Fri, Dec 8, 2017 at 6:20 PM, Dale Henrichs via Glass <[hidden email]> 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

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass