Problem with table being really slow

Problem with table being really slow

am 07.03.2007 20:39:15 von dave

Hi,

One of my tables has over 1 million records.

It is set up as...

ID int(11) unsigned NOT NULL auto_increment,
Company varchar(50) default NULL,
MainCategory varchar(75) default NULL,
Category varchar(75) default NULL,
ProductName varchar(255) default NULL,
ProductDescription text,
Price varchar(10) default NULL,
ImageURL tinytext,
DeepLink tinytext,
InternalExternal char(3) default NULL,
adLocation tinyint(1) default '1',
AffiliateWindow tinyint(3) unsigned default '0',
AffiliateCompany varchar(25) NOT NULL default '',
PRIMARY KEY (ID),
FULLTEXT KEY NewIndex (Category,Company,ProductDescription,ProductName),
KEY CompanyIndex (Company)
) TYPE=MyISAM;


I search on...

SELECT ProductList.*, MATCH (Company, Category, ProductName,
ProductDescription)
AGAINST ('MySearchQuery') as rating
FROM ProductList
where ImageURL <> '' and ((MATCH (Company, Category, ProductName,
ProductDescription)
AGAINST ('MySearchQuery')) > 3) order by rand() limit 6


or


SELECT ProductList.*, MATCH (Company, Category, ProductName,
ProductDescription)
AGAINST ('MySearchQuery') as rating
FROM ProductList
where ((MATCH (Company, Category, ProductName, ProductDescription)
AGAINST ('MySearchQuery')) > 0)


or


select * from ProductList where Company like 'MySearchQuery'


I am looking at how to set up the indexing for best effect. I did at one
time have "select distinct company" as well, but that was REALLY slow, so I
set up a seperate table to just hold the Company name to try and speed
things up a bit.

I am using ODBC to connect and the database is 3.23.58

Thanks for any help you can offer.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available