English 中文(简体)
当MySQL重建一个多边贸易体系指数时?
原标题:When does MySQL rebuild a FTS index?

如果您希望使用MySQL 全文检索功能,请说明关于外地的完整文本索引,编号为VARCHAR。 由于电离层是INSERTed 和UPDATEd,我的sql必须随时更新指数。 我的问题是: 当MySQL重建一个多边贸易体系指数时?

  • A) Immediately after a INSERT or UPDATE occurs that affects the index.
  • B) When the first SELECT is run that needs the index which has recently been affected by a UPDATE or INSERT.
  • C) Something else.

Unecessary background info: My experience seems to think option B. Is this right? I ask because I have been experiencing sudden random slow queries which do a Full Text Search and I don t know why some are slow and not the others. My hunch is that the queries can be slow if they are waiting for mysql to rebuild the FTS index, but I don t know if this is how mysql works. Example of a random slow query (usually the same query runs under a second), there is no slow UPDATE or INSERT in the slow log:

# Query_time: 61.775612  Lock_time: 10.110924 Rows_sent: 20  Rows_examined: 222498
SELECT SQL_CALC_FOUND_ROWS id
FROM members
WHERE
    AND MATCH (bio,profile_text,name) AGAINST ( building surveyor )
    AND MATCH (town, postcode, country) AGAINST ( united kingdom, liverpool );

通知日期: 我看不出其他的INSERT或UPDATE在缓慢的标志中,因此我无法确定它正在等待什么。 正因为如此,我猜测,它可能等待重新建立金融体系指数?

最佳回答

Consider using ... AGAINST( "building surveyor" ) to get that phrase instead of those two words scattered anywhere.

你们是否使用MyISAM或InnoDB? 他们的工作不同。

MyISAM, 我想,updates FTindexes一行插入/更新。

我认为,诺非行将提出修改意见,并最终将其写成光盘。 这通常比我的ISAM更快。

发动机rebuilds 指数,除非明确要求。

问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签