It looks like your db is dead. Getting rid of an internal query is a key part of optimization. Try this (untested) query:
SET @SEARCH = "dokumentalne"; SELECT SQL_NO_CACHE aa.idarticle AS `AdressInSQL`, aa.contents AS `Contents`, aa.topic AS `Topic`, MATCH(aa.topic , aa.contents) AGAINST (@SEARCH) AS `Relevance`, ia.url AS `URL`, MAX(aa.version) AS `Version` FROM xv_article AS aa, xv_articleindex AS ia WHERE aa.idarticle = ia.adressinsql AND ia.accepted = "yes" AND MATCH(aa.topic , aa.contents) AGAINST (@SEARCH) GROUP BY aa.idarticle, aa.contents, `Relevance`, ia.url ORDER BY `Relevance` DESC LIMIT 0, 30
To optimize your query, you can also share the receipt of articles with the latest version from full-text search, since the latter is the most expensive. This can be done by subquery (also not tested on your db):
SELECT SQL_NO_CACHE iq.idarticle AS `AdressInSQL`, iq.topic AS `Topic`, iq.contents AS `Contents`, iq.url AS `URL`, MATCH(iq.topic, iq.contents) AGAINST (@SEARCH) AS `Relevance` FROM ( SELECT a.idarticle, a.topic, a.contents, i.url, MAX(a.version) AS version FROM xv_article AS a, xv_articleindex AS i WHERE i.accepted = "yes" AND a.idarticle = i.adressinsql GROUP BY a.idarticle AS id, a.topic, a.contents, i.url ) AS iq WHERE MATCH(iq.topic, iq.contents) AGAINST (@SEARCH) ORDER BY `Relevance` DESC LIMIT 0, 30
source share