Index inline size

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

Index inline size

Hi,

I have set sqlIndexMaxInline size in cache configuration level as follows.

cacheCfg.setSqlIndexMaxInlineSize(100);

But still  I am getting following warning message in log.

WARN  o.a.i.i.p.q.h2.database.H2TreeIndex - <USER_ACCOUNT_CACHE> Indexed columns of a row cannot be fully inlined into index what may lead to slowdown due to additional data page reads, increase index inline size if needed (use INLINE_SIZE option for CREATE INDEX command, QuerySqlField.inlineSize for annotated classes, or QueryIndex.inlineSize for explicit QueryEntity configuration) [cacheName=USERACCOUNTDATA, tableName=USER_ACCOUNT_CACHE, idxName=USER_ACCOUNT_IDX4, idxCols=(SUBSCRIPTIONID, UNITID, _KEY, AFFINITYID), idxType=SECONDARY, curSize=10, recommendedInlineSize=83]

1) Is it necessary to set inline size using @QuerySqlField annotation?

2) How do I set inline size in case of group index in following case?
Do I need to set inline property inside each @QuerySqlField annotation?

public class Person implements Serializable {
  /** Indexed in a group index with "salary". */
  @QuerySqlField(orderedGroups={@QuerySqlField.Group(
    name = "age_salary_idx", order = 0, descending = true)})
  private int age;

  /** Indexed separately and in a group index with "age". */
  @QuerySqlField(index = true, orderedGroups={@QuerySqlField.Group(
    name = "age_salary_idx", order = 3)})
  private double salary;
}






Thanks,
Prasad
Denis Mekhanikov Denis Mekhanikov
Reply | Threaded
Open this post in threaded view
|

Re: Index inline size

Prasad,

By default QuerySqlField#inlineSize is equal to -1, which means, that it will be chosen automatically.
CacheConfiguration#setSqlIndexMaxInlineSize specifies the maximal automatically calculated 
inline size for a cache.
But if QuerySqlField#inlineSize is not -1, then it will be used regardless of the configured maximum.
It should only be less than 2048. Otherwise 2048 will be used.

Judging by the warning message, value 10 is used for the inline size. 
Did you specify it manually or was it calculated automatically?


Denis

ср, 26 дек. 2018 г. в 18:27, Prasad Bhalerao <[hidden email]>:
Hi,

I have set sqlIndexMaxInline size in cache configuration level as follows.

cacheCfg.setSqlIndexMaxInlineSize(100);

But still  I am getting following warning message in log.

WARN  o.a.i.i.p.q.h2.database.H2TreeIndex - <USER_ACCOUNT_CACHE> Indexed columns of a row cannot be fully inlined into index what may lead to slowdown due to additional data page reads, increase index inline size if needed (use INLINE_SIZE option for CREATE INDEX command, QuerySqlField.inlineSize for annotated classes, or QueryIndex.inlineSize for explicit QueryEntity configuration) [cacheName=USERACCOUNTDATA, tableName=USER_ACCOUNT_CACHE, idxName=USER_ACCOUNT_IDX4, idxCols=(SUBSCRIPTIONID, UNITID, _KEY, AFFINITYID), idxType=SECONDARY, curSize=10, recommendedInlineSize=83]

1) Is it necessary to set inline size using @QuerySqlField annotation?

2) How do I set inline size in case of group index in following case?
Do I need to set inline property inside each @QuerySqlField annotation?

public class Person implements Serializable {
  /** Indexed in a group index with "salary". */
  @QuerySqlField(orderedGroups={@QuerySqlField.Group(
    name = "age_salary_idx", order = 0, descending = true)})
  private int age;

  /** Indexed separately and in a group index with "age". */
  @QuerySqlField(index = true, orderedGroups={@QuerySqlField.Group(
    name = "age_salary_idx", order = 3)})
  private double salary;
}






Thanks,
Prasad
colinc colinc
Reply | Threaded
Open this post in threaded view
|

Re: Index inline size

The documentation that you referenced states that the
IGNITE_MAX_INDEX_PAYLOAD_SIZE system property defines the default max - and
that this defaults to 10.

Since it's only a maximum value, is there any reason why it can't be a bit
higher - say 100? Or is it strongly encouraged to keep indexed fields
shorter than this?

Regards,
Colin.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Stanislav Lukyanov Stanislav Lukyanov
Reply | Threaded
Open this post in threaded view
|

Re: Index inline size

Depends on the use case. Sometimes you want to save the memory as much as
possible, and then you would use a lower inline size.

However, in most cases you actually need a higher value because that will
greatly improve the performance.
Starting 2.7 there are warnings with a recommended size (calculated based on
your actual data) and a way to set it.
A couple of ways to change inline size are missing in the warnings though -
check https://issues.apache.org/jira/browse/IGNITE-11355.

Stan


colinc wrote

> The documentation that you referenced states that the
> IGNITE_MAX_INDEX_PAYLOAD_SIZE system property defines the default max -
> and
> that this defaults to 10.
>
> Since it's only a maximum value, is there any reason why it can't be a bit
> higher - say 100? Or is it strongly encouraged to keep indexed fields
> shorter than this?
>
> Regards,
> Colin.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/