[ 
https://issues.apache.org/jira/browse/IGNITE-15547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424359#comment-17424359
 ] 

Maksim Timonin edited comment on IGNITE-15547 at 10/5/21, 8:46 AM:
-------------------------------------------------------------------

[~andrian.boscanean] hi! This patch looks good to me, I've put some minor 
comments on the PR page, please have a look.

 

[~andrian.boscanean] I do have concerns about performance of using enums in 
indexes. Using POJO (enum will be considered as POJO) in indexes is possible, 
but there are tread offs, and the main one is speed of comparison of equal 
elements (yes, comparison of non-equal elements is pretty fast, but in case of 
equality of POJO items in index there are additional checks and they aren't 
optimal). As I understand there are a lot of equal elements in your case, as 
you want use enum. So, I'd suggest you to test performance of your case. If 
results won't be OK, it may be faster to use INT instead of ENUM.


was (Author: timonin.maksim):
[~andrian.boscanean] hi! This patch looks good to me, I've put some minor 
comments on the PR page, please have a look.

 

[~andrian.boscanean] , changes your suggest will work. But I do have concerns 
about performance of using enums in indexes. Using POJO (enum will be 
considered as POJO) in indexes is possible, but there are tread offs, and the 
main one is speed of comparison of equal elements (yes, comparison of non-equal 
elements is pretty fast, but in case of equality of POJO items in index there 
are additional checks and they aren't optimal). As I understand there are a lot 
of equal elements in your case, as you want use enum. So, I'd suggest you to 
test performance of your case. If results won't be OK, it may be faster to use 
INT instead of ENUM.

> QueryTypeDescriptorImpl: Accept Classes/Enums extending an Interface which is 
> used as cache indexed field
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-15547
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15547
>             Project: Ignite
>          Issue Type: Improvement
>    Affects Versions: 2.10
>            Reporter: Andrian Boscanean
>            Assignee: Andrian Boscanean
>            Priority: Major
>             Fix For: 2.12
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Currently Classes/Enums that extend an interface which is used as Indexed 
> field are not allowed.
> Example 
> @QuerySqlField(index = true)
>  private TestInterface testInterface;
> ------
> enum TestEnum1 implements TestInterface
> { VALUE_1, VALUE_2, VALUE_3 }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to