Advertisement

09.28.2008 at 01:21PM PDT, ID: 23769946
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

Need to speed up my query which takes 11 second and uses multiple tables

Asked by mindwarpltd in MySQL Server

Tags: , ,

I have the following table.
CREATE TABLE `keywords` (
  `Word` varchar(20) NOT NULL,
  `PadID` bigint(20) NOT NULL,
  `LetterIdx` varchar(1) NOT NULL,
  KEY `Word` (`Word`),
  KEY `LetterIdx` (`LetterIdx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

And heres some example data.

INSERT INTO `keywords` (`Word`, `PadID`, `LetterIdx`) VALUES
('error', 65010, 'E'),
('fix', 65010, 'F'),
('clean', 65010, 'C'),
('windows cleaner', 65010, 'W'),
('registry tools', 65010, 'R'),
('windows tweak', 65010, 'W'),
('windows error', 65010, 'W'),
('system maintainance', 65010, 'S'),
('registry repair', 65010, 'R'),
('registry cleaner', 65010, 'R');

PadID is the key to my main table (My main table is called Pads, records for programs I show on my website, its a shareware download site), LetterIdx is the first letter of Word.
So I can product a list of word with the same letter.

Heres an example.
http://www.softtester.com/keywords-b.shtml

I have program page on my website, which show details about one program.
I have a query to create a list of 10 programs which match the current program based on keywords.

select count(match_keywords.Word) as matching_words ,pads.* from keywords current_program_keywords left join keywords match_keywords on match_keywords.Word=current_program_keywords.Word inner join pads on pads.padID=match_keywords.PadID where match_keywords.Word IS NOT NULL and current_program_keywords.PadID=59621 group by match_keywords.PadID order by matching_words DESC LIMIT 0,11;

The query finds the most matches of keywords and order by the most number of matches.
Unfortunately the query takes 11 seconds and my dynamic page is called a lot as its the main page on my site, I mean the same PHP is used to show different records a lot.

I need to make the query very quick, HELP!

PLEASE FEEL FREE TO ASK ANY QUESTIONS.Start Free Trial
[+][-]09.28.2008 at 03:08PM PDT, ID: 22592752

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL Server
Tags: Sun, MySQL, 5
Sign Up Now!
Solution Provided By: TerryAtOpus
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.01.2008 at 05:26AM PDT, ID: 22613478

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 14-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10.01.2008 at 05:37AM PDT, ID: 22613559

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 - Hierarchy / EE_QW_2_20070628