Home » Performance » FullText » Slow COUNT query that uses a fulltext index
icon9.gif  Slow COUNT query that uses a fulltext index [message #2205] Thu, 15 November 2007 10:12 Go to previous message
hammet  is currently offline hammet
Messages: 1
Registered: November 2007
Location: Ukraine / Donetsk
Junior Member

Hi,

I have a slow count(*) query that uses a fulltext index and i can't find out why execution time is so awful. The query as it
stands takes about ~2-5 sec to execute, depends of found rows quantity.

Here's the query:
SELECT COUNT(*) AS found
FROM `t1` WHERE MATCH (fullsearch) 
AGAINST ('+объявлен' IN BOOLEAN MODE)

later i've found that this query goes faster:
SELECT COUNT(MATCH (fullsearch) 
AGAINST ('+объявлен' IN BOOLEAN MODE)) AS found
FROM `t1` WHERE MATCH (fullsearch) 
AGAINST ('+объявлен' IN BOOLEAN MODE)


the results are follow:
Found 161354 of 322271 rows.
Execution time: 3.4158 sec.

Here is EXPLAIN:
id: 1
select_type: SIMPLE
table: t1
type: fulltext
possible_keys: fullsearch
key: fullsearch
key_len: 0
ref:
rows: 1
Extra: Using where

What can i do to count found rows? is there any suggestion that can be applied to speed this up?

Any insight would be appreciated!

Read Message
Read Message
Previous Topic:AND as the default modifier for boolean search
Next Topic:DB Design for search
Goto Forum:

  



Current Time: Fri Aug 29 17:44:22 EDT 2008

Total time taken to generate the page: 0.03196 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge