问题标签 [query-cache]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
829 浏览

symfony-1.4 - Doctrine 查询缓存仅适用于给定的应用程序

是否有可能为给定的应用程序启用Doctrine 的查询缓存?在 Configuration.class.php 中尝试过,但没有运气。

0 投票
2 回答
3319 浏览

php - 删除 CodeIgniter 查询缓存

当我在 CodeIgniter 中进行查询缓存时,$this->db->cache_on();它将创建文件夹和文件,controller+method例如以show+73. 但是当我从表中删除具有 73 id 的行并$this->db->cache_delete('show', $id);用于删除缓存时,它也不起作用。它存在并在我调用时返回响应我show/73 应该如何解决它?

我的代码:

返回结果(在模型中)

从表中删除行和缓存。(它会成功从表中删除行,但不能删除它的缓存)

0 投票
1 回答
824 浏览

mysql - 选择性清除 MySQL 查询缓存(仅清除一个特定查询)

我只需要尝试并清除缓存中的单个查询(实际上是存储过程),以便对其进行调试并客观地确定我们的优化是否有效。它在我们没有备份的客户生产系统上,并且执行数据库范围的查询缓存重置将是灾难性的。

0 投票
2 回答
1297 浏览

hibernate - 为什么 Hibernate 使用每个 SQL 查询更新 UpdateTimestampsCache

我在我的应用程序中启用了二级和查询缓存看起来像当我调用以下代码时

休眠更新所有表的 UpdateTimestampsCache。他为什么这样做?我的应用程序中有大约 1000 个表和许多 sql 查询。我不需要此更新,因为我不通过 sql 更新缓存表。它会导致巨大的网络流量和应用程序缓慢。

有没有办法告诉休眠在运行 sql 查询时不做任何更新?

0 投票
1 回答
283 浏览

java - 查询缓存如何处理标量结果?

我是 Hibernate 的新手,我的 DAO 实现类中有以下代码:

我正在使用带有 EhCache 的 Hibernate。我想知道我是否在这里正确使用查询缓存?我知道对于域对象,查询缓存存储从查询字符串和绑定参数到主键的映射。但是,标量值是如何缓存在内存中的?

0 投票
2 回答
166 浏览

mysql - 从大型 MySQL 数据库中快速获取顶级指标?

我痛苦地意识到这可能没有灵丹妙药,但它正在成为一个问题。每个用户都有数十万行跨 3 个表的指标数据,这些数据每秒更新一次。

当用户登录时,我想快速为他们提供一些资产的顶级统计数据(即在导航中的每个资产旁边,他们都有顶级统计数据)。

我尝试了很多想法;但是请-如果有人在这方面有一些建议或经验,那就太好了。到目前为止尝试或研究的东西:-

  • 每小时左右生成顶级统计数据的静态版本 - 这对所有用户和所有资产都是密集的。因此,如何定期执行此操作,我不确定。
  • 通过 AJAX 调用统计信息,以便在页面加载后对其进行处理和填写(对于较大的用户来说,现在获取顶级统计信息最多需要 10 秒)。这也可以在会话中缓存统计信息,以节省每次页面加载的重做查询。
  • 查询以 30 分钟的间隔运行,即您登录,它会查询,然后它希望每次加载(仅 1/2 秒)时都使用查询缓存,直到下一个 30 分钟的间隔。

第一个似乎拥有最多的腿,但我不知道如何做到这一点,因为只有少数用户需要这些统计数据 - 一直为每个人做这件事似乎非常昂贵。

0 投票
1 回答
3868 浏览

mysql - mysql:qcache_not_cached

我试图了解是否有办法获取 mysql query_cache 未缓存的查询。我确实尝试查看在我的任何查询中是否有对“SQL_NOCACHE”的任何明确引用,但它们都没有返回该字符串。而且我仍然看到未缓存的查询持续增加。其中的百分比约为 5-10%,但我想看看我是否可以将它们缓存在 memcache 上,如果查询缓存不缓存它们。

那么有没有一种真正的方法来记录没有被缓存的查询?

0 投票
1 回答
1899 浏览

java - 休眠查询缓存问题

我在我的应用程序中发现了一个奇怪的错误。我已经简化了它,这就是它可以复制的方式:

(我使用 DbUnit 创建表并将 HSQLDB 作为数据库,但这实际上并不重要)

输出是:

看起来缓存以某种方式配置错误。哪里有错误,我该如何解决?

用过的:

  • JDK 1.7.0_01 x32 和 x64
  • 休眠 3.6.7
  • Ehcache 2.5.0
  • 春天 3.1.0
  • 数据库:至少适用于 HSQLDB、H2 和 MySQL
0 投票
1 回答
493 浏览

hibernate - Does the Hibernate Query Cache work in Dom4J mode

Background: Our project team is using Hibernate's dom4j entity mode to generate SOAP responses for a multiple client applications. The amount of data being delivered is massive and response time is an issue. We can significantly reduce the number of SQL calls by using the Hibernate Query Cache and/or the 2nd Level Cache. Due to the architecture of our system, the 1st Level Cache (Session) level mechanism will not improve performance in the way that Query Cacheing at the SessionFactory works.

Question: The underlying question is whether Hibernate's DOM4J Entity mode is compatible with Query cacheing. Query results are being put into the Query Cache. However, when a query.list() method executes and a matching cached query is found, then the following exception is thrown:

Caused by:

Our environment is Core-Spring/Hibernate...

In our spring-hibernate session factory configuration, the following configuration is used:

Initial Analysis: My gut feeling is that Hibernate's "experimental" DOM4J entity mode is not compatible with the Query and Entity Cache. It is also important to note that our Hibernate hbm.xml mapping files using dynamic mapping. That is, the mapping files do not have Class references; instead they have entity references. Thus, the XML responses get generated directly without populating a class's objects.

I would be tremendously grateful for any assistance in this matter.

0 投票
1 回答
233 浏览

mysql - 什么时候在 MySQL 中使用 query_cache?

我已经阅读了 query_cache 作为提高查询性能的一个非常重要的工具。

一般建议是按需启用(使用 SELECT SQL_CACHE,query_cache_type = 2 配置设置)。

  • 什么类型的情况会使 MySQL 中的 query_cache 更加优化?