简体   繁体   English

Ignite CacheStore 上的 Sql 查询

[英]Sql query over Ignite CacheStore

I have a Cache with cachestore , built by CacheJdbcPojoStoreFactory.我有一个带有 cachestore 的缓存,由 CacheJdbcPojoStoreFactory 构建。 The problem is: when I try to query cache, it seems that it only runs over memory(Read-Through is not applied in this case).问题是:当我尝试查询缓存时,它似乎只在内存上运行(在这种情况下不应用通读)。 I expect it to look if memory contains.我希望它看看内存是否包含。 If not, then it should query database(But also in that case, cache will never know that if all the data it needs locate on memory but maybe index can provide that fast).如果没有,那么它应该查询数据库(但在这种情况下,缓存永远不会知道它需要的所有数据是否都位于内存中,但索引可以提供那么快)。

Am I missing something or is this the behavior of it?我错过了什么还是这是它的行为?

Thx谢谢

This is correct behavior.这是正确的行为。 SQL queries don't do read-through, because read-through in a key-value storage is possible only by key, which is impossible with SQL where the set of required keys is unknown. SQL 查询不进行通读,因为键值存储中的通读只能通过键进行,而对于所需键集未知的 SQL,这是不可能的。

Having said that, you need to have all the data required for the query in memory prior to its execution.话虽如此,您需要在执行之前将查询所需的所有数据保存在内存中。 You can use loadCache() method to bulk-load the data into the cache.您可以使用loadCache()方法将数据批量加载到缓存中。 See this page for details: https://apacheignite.readme.io/docs/data-loading#ignitecacheloadcache有关详细信息,请参阅此页面: https : //apacheignite.readme.io/docs/data-loading#ignitecacheloadcache

Also GridGain is developing a new enterprise feature which will allow to achieve exactly what you describe, but with a proprietary underlying disk storage.此外, GridGain正在开发一项新的企业功能,该功能将允许实现您所描述的内容,但具有专有的底层磁盘存储。 This will still not be possible with an abstract persistent store, like a relational database.这对于抽象的持久存储仍然是不可能的,比如关系数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM