如何提高此搜索查询的速度?
此搜索带来基于时间、标题和文本的新闻。每个项目都有自己的因素。
SELECT * , MATCH (`title`) AGAINST ('tax in work') * 1.65 AS `titlescore` ,
(
(
CASE
WHEN time >=1432173380 THEN 21
WHEN time >=1432162580 THEN 18
WHEN time >=1432097780 THEN 15
WHEN time >=1431903380 THEN 11
WHEN time >=1431320180 THEN 7
ELSE 0
END
) * 1.75 ) AS `timescore` ,
MATCH (`text`) AGAINST ('tax in work') * 0.65 AS `textscore`
FROM `news`
HAVING `titlescore` + `timescore` + `textscore` >= 35
ORDER BY `titlescore` + `timescore` + …
Run Code Online (Sandbox Code Playgroud) 在 mysql 数据文件夹中,未知文件是这样创建的:
这是 my.ini 的内容:
[client]
host= .
port= 3306
socket= "MySQL"
[mysql]
no-auto-rehash
[mysqld]
max_allowed_packet = 800M
thread_concurrency = 8
skip-external-locking
port=3306
basedir="c:/zpanel/bin/mysql/"
datadir="e:/hafez/bin/mysql/mysql5.5.24/data/"
character-set-server=utf8
default-storage-engine=MYISAM
max_connections=200
query_cache_size = 128M
table_cache=256
tmp_table_size=256M
thread_cache_size=8
myisam_max_sort_file_size=32G
myisam_sort_buffer_size=205M
key_buffer_size = 384M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 2M
innodb_fast_shutdown=0
innodb_additional_mem_pool_size = 16M
innodb_log_buffer_size = 8M
innodb_buffer_pool_size=1800MB
innodb_log_file_size = 256M
innodb_thread_concurrency = 16
innodb_lock_wait_timeout = 120
innodb_file_per_table
innodb_doublewrite = 0
log-bin = 0
innodb_support_xa = 0
innodb_flush_log_at_trx_commit = 0
tmpdir= …
Run Code Online (Sandbox Code Playgroud)