@Documented @Retention(value=RUNTIME) @Target(value=FIELD) public @interface QuerySqlField
CacheQuery
documentation.CacheQuery
Modifier and Type | Optional Element and Description |
---|---|
boolean |
descending
Specifies whether index should be in descending order or not.
|
String[] |
groups
Array of index groups this field belongs to.
|
boolean |
index
Specifies whether cache should maintain an index for this field or not.
|
int |
inlineSize
Index inline size in bytes.
|
String |
name
Property name.
|
boolean |
notNull
Specifies whether the specified field can be
null . |
QuerySqlField.Group[] |
orderedGroups
Array of ordered index groups this field belongs to.
|
int |
precision
Specifies field precision for variable length types - decimal, string and byte array.
|
int |
scale
Specifies scale for a decimal field.
|
public abstract boolean index
When indexing SPI and indexed field is
of type org.locationtech.jts.geom.Geometry
(or any subclass of this class) then Ignite will
consider this index as spatial providing performance boost for spatial queries.
True
if index must be created for this field in database.public abstract boolean descending
index()
property is set to true
.True
if field index should be in descending order.public abstract boolean notNull
null
.True
if the field is not allowed to accept null
values.public abstract int precision
public abstract int scale
public abstract String[] groups
Group indexes are needed because SQL engine can utilize only one index per table occurrence in a query.
For example if we have two separate indexes on fields a
and b
of type X
then
query select * from X where a = ? and b = ?
will use for filtering either index on field a
or b
but not both. For more effective query execution here it is preferable to have a single
group index on both fields.
For more complex scenarios please refer to QuerySqlField.Group
documentation.
public abstract QuerySqlField.Group[] orderedGroups
groups()
public abstract String name
public abstract int inlineSize
Allowed values:
-1
(default) - determine inline size automatically (see below)0
- index inline is disabled (not recommended)-1
, Ignite will try to detect inline size automatically. It will be no more than
CacheConfiguration.getSqlIndexMaxInlineSize()
. Index inline will be enabled for all fixed-length types,
but will not be enabled for String
.
When index group is used, inline size must be defined in QueryGroupIndex.inlineSize()
. Any value
except of -1
defined on a specific column will lead to exception.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023