mysql - 错误 188 (HY000) : FTS query exceeds result cache limit mysql

标签 mysql indexing full-text-search

我的表格的文本列上有全文索引,大约有 1100 万行。

表结构:

CREATE TABLE `review` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `title` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `reviewer_id` (`reviewer_id`),
  FULLTEXT KEY `comments` (`comments`)
) ENGINE=InnoDB AUTO_INCREMENT=273001866 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED;

我试过搜索:
SELECT 
    id
FROM
    review
WHERE  MATCH (comments) AGAINST ('"This is review is only for Campus tours and not for University itself as no one can write a review on University"' IN BOOLEAN MODE)

这是抛出以下错误:
ERROR 188 (HY000): FTS query exceeds result cache limit

谷歌说这是 mysql 在 5.7 中修复的错误。我正在使用 5.7.19。
任何想法如何解决这个问题。
复制粘贴 ft 变量:
mysql> show global variables like 'innodb_ft%';
+---------------------------------+--------------------+
| Variable_name                   | Value              |
+---------------------------------+--------------------+
| innodb_ft_aux_table             |                    |
| innodb_ft_cache_size            | 8000000            |
| innodb_ft_enable_diag_print     | OFF                |
| innodb_ft_enable_stopword       | ON                 |
| innodb_ft_max_token_size        | 84                 |
| innodb_ft_min_token_size        | 3                  |
| innodb_ft_num_word_optimize     | 2000               |
| innodb_ft_result_cache_limit    | 2000000000         |
| innodb_ft_server_stopword_table | local/my_stopwords |
| innodb_ft_sort_pll_degree       | 2                  |
| innodb_ft_total_cache_size      | 640000000          |
| innodb_ft_user_stopword_table   |                    |
+---------------------------------+--------------------+
12 rows in set (0.00 sec)

最佳答案

我在为 text 添加全文索引后遇到了这个问题大表中的列(1000 万行)。
以前我通过重新启动服务器解决了这个问题,但现在我无法重新启动它,因为它正在执行一些计算。

通过调整此设置(比默认值多 2 倍)解决了这个问题:

SET GLOBAL innodb_ft_result_cache_limit = 4000000000;

关于mysql - 错误 188 (HY000) : FTS query exceeds result cache limit mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46172668/

相关文章:

mysql - 我可以在共享主机上更改 "ft_min_word_len"吗?

mysql - SQL查询错误,需要帮助

SQL:如何从表中选择第 1、3、11 和第 n 行?

php - 如何在多个表中使用group_contat()函数?

在列表中查找最大值(和索引)的 Pythonic 方法

performance - 应该将 search_data tsvector 存储在同一张表还是外部表中?

php - 从 URL 中去除撇号

indexing - 获取 UITableView 中选定附件按钮的 IndexPath

python - 在python中查找两个数组之间互斥元素的索引

elasticsearch - 在Elastic的_all字段中搜索并返回突出显示的结果