Hi there,

I have some trouble understanding some results I'm getting when
executing a SELECT statement in an FULLTEXT indexed table in my MySql
db.

In scenario 1 I'm using this SQL-statement:

SELECT * FROM tArticles WHERE ( Title LIKE '%HYDRO%' OR Body LIKE
'%HYDRO%' )

In scenario 2 I'm using this SQL-statement:

SELECT * FROM tArticles WHERE ( MATCH( Title, Body ) AGAINST( 'HYDRO' )
)

My problem is that if I'm searching for a word (For instance HYDRO) that
are found in a lot of my articles, then scenario 1 is much faster than
scenario 2. But if the search word is in just a few of the articles then
scenario 2 is _much_ faster than scenario 1. Can someone explain this to
me? What do I do?

I'm running MySql 3.23.46 on Solaris 8.


My table creation statement looks like this:

CREATE TABLE tArticles (
  ArticleId int(11) NOT NULL auto_increment,
  Title varchar(255) NOT NULL default '',
  Author varchar(255) NOT NULL default '',
  Version int(3) NOT NULL default '0',
  TickerCodes varchar(255) NOT NULL default '',
  SubjectCodes varchar(255) NOT NULL default '',
  MessageNum varchar(20) NOT NULL default '',
  Timestamp datetime NOT NULL default '0000-00-00 00:00:00',
  Body text NOT NULL,
  Footer varchar(255) NOT NULL default '',
  PRIMARY KEY  (ArticleId),
  KEY Timestamp (Timestamp),
  FULLTEXT KEY Title (Title,Body)
) TYPE=MyISAM;


-- 
Jakob Vad Nielsen <[EMAIL PROTECTED]>
NHST


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to