Apache Ignite Query Cursor getAll非常慢

时间:2018-05-29 12:25:11

标签: apache ignite

我有200个缓存加载到单个数据区域。其中我有一个 customerCache有300K记录。它有许多索引字段,包括 顾客号码。

当我在此特定缓存上使用 SQLFieldsQuery 进行查询时(其中 条件只有客户编号=?),查询a需要 280ms 客户!!!!

在详细分析中,我发现 SQLFieldQueryCursor.getAll()是 占用99%的时间(获取缓存实例和查询执行是 在纳秒至1毫秒范围内完成)。有没有办法调整 cursor.getAll()或从游标获取数据的任何替代方法。

更多信息

我在@Id上注明了客户编号,因此假设它们已编入索引,并且所有查询的字段都使用@QuerySqlField注释

缓存配置如下:

dataRegionCfg.setInitialSize(8L * 1024 * 1024 * 1024);
dataRegionCfg.setMaxSize(8L*1024*1024*1024);
dataRegionCfg.setPersistenceEnabled(false);
dataStorageCfg.setDataRegionConfigurations(dataRegionCfg);
dataStorageCfg.setPageSize(4096);
customerCacheConfig = new CacheConfiguration<>("customerCache");
customerCacheConfig.setIndexedTypes(CustomerKey.class, Customer.class);
customerCacheConfig.setReadThrough(false);
customerCacheConfig.setAtomicityMode(ATOMIC);
customerCacheConfig.setCacheMode(CacheMode.LOCAL);

我的疑问是:

从CustomerMaster中选择customerName,customerId,其中customerNumber =?;

请提供一些提高性能的提示或让我知道我是否 在这里遗漏了什么

1 个答案:

答案 0 :(得分:0)

感谢Alamar以正确的方式指出。我在服务器节点中部署的jar错过了index = true选项。

同时点燃不会指望密钥类中的索引。同样,性能不会通过增加数量或指数来改善,就像H2一样。

相关问题