ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: Sorting behaviour on Time Series data in partitioned cache
Date Wed, 23 Dec 2015 07:44:16 GMT
Hi Welly,

"chId" field of your TimeSeries class is not indexed. So your query is 
doing a full scan.
Modify class definition this way and check the result

case class TimeSeries(@(QuerySqlField @field)*(index = true)***chId: UUID,@(QuerySqlField
@field)(index =true) idx: Long, value: Any)extends Serializable


On 12/23/2015 10:27 AM, Welly Tambunan wrote:
> Hi All,
> I have a node with this configuration for working with TimeSeries
> valcacheConfig =new CacheConfiguration[SeriesKey, TimeSeries]("time-series")
> cacheConfig.setCacheMode(CacheMode.PARTITIONED)
> cacheConfig.setIndexedTypes(classOf[SeriesKey],classOf[TimeSeries])
> val cfg =new IgniteConfiguration()
> cfg.setCacheConfiguration(cacheConfig)
> The class i have is the simple one like this
> case class SeriesKey(@AffinityKeyMapped chId: UUID, idx: Long)extends Serializable
> case class TimeSeries(@(QuerySqlField @field) chId: UUID,@(QuerySqlField @field)(index
=true) idx: Long, value: Any)extends Serializable
> I expect that the series with the same channel will be cached in a 
> single node and it will be sorted based on the index. However when i'm 
> querying the cache like this i found out of order series.
> val sql =new SqlQuery(classOf[TimeSeries],"chId = ?")val chId = UUID.fromString("274061d5-7b48-4b35-b08a-1742c97865ef")
> // Find only persons earning more than 1,000. val cursor = cache.query(sql.setArgs(chId))
> I'm confuse with this behavior as it seems doesn't index the 
> TimeSeries right. If i add the order by idx it works fine even when i 
> don't set querysqlfield index=true
> Any thoughts ?
> Cheers
> -- 
> Welly Tambunan
> Triplelands
> http://weltam.wordpress.com
> http://www.triplelands.com <http://www.triplelands.com/blog/>

View raw message