Я пытаюсь получить 10 лучших совпадений при полнотекстовом поиске, используя полнотекстовую оценку.
Следующий запрос отлично работает в моей таблице MyISAM на 10 миллионов строк:
SELECT
index,
MATCH(villes) AGAINST('montreuil') as score
FROM
(
SELECT index, villes
FROM table
WHERE MATCH(villes) AGAINST('montreuil' IN BOOLEAN MODE)
) t
Однако, когда я получаю сообщение об ошибке при попытке получить оценки заказа:
SELECT index
FROM (
*** PREVIOUS QUERY ***
) t2
ORDER BY t2.score
Ошибка: «Потеряно соединение с сервером MySQL» в MySQL через 4 секунды.
Пока я пробовал:
- с использованием phpmyadmin => та же ошибка
- удаление "order by" => та же ошибка
- расширение буферной памяти mysql => та же ошибка
- ограничение количества результатов подзапроса до 10 (с использованием "limit 10") => странная ошибка "не удается найти полнотекстовый индекс"
Мне не понятен лог mysql:
10:10:58 UTC - mysqld got exception 0xc00000fd ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=67108864
read_buffer_size=8388608
max_used_connections=3
max_threads=151
thread_count=2
connection_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 2541349 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x21ee0a9b580
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
2019-04-16T10:11:12.359438Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
EDIT
ПОКАЗАТЬ СОЗДАТЬ СТОЛ:
'CREATE TABLE `table` (
`index` int(11) NOT NULL,
`villes` text,
PRIMARY KEY (`index`),
FULLTEXT KEY `villes` (`villes`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8'
ОБЪЯСНИТЬ:
type: fulltext
possible keys: villes
key: villes
ref: const
rows: 1
filtered: 100.00
extra: using where, using filesort