Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to improve MYSQL search performance of perl?

by trammell (Priest)
on Aug 18, 2005 at 16:52 UTC ( #484874=note: print w/ replies, xml ) Need Help??


in reply to How to improve MYSQL search performance of perl?

There is great online MySQL documentation available at http://dev.mysql.com/doc/, specifically a chapter on optimizing queries at http://dev.mysql.com/doc/mysql/en/query-speed.html.


Comment on Re: How to improve MYSQL search performance of perl?
Re^2: How to improve MYSQL search performance of perl?
by nan (Novice) on Aug 19, 2005 at 15:40 UTC

    Hi,

    Many many thanks for that great article but a question just poped up after reading. It says that mySQL will build indexes for the whole table when calling "CREAT TABLE ....." I suppose it means that I don't need to rebuild an index (my table only has two columns). Ok, even I rebuild an index by myself, how it can be used?

    Thanks again,

    Nan

      MySQL will choose the appropriate index for the tables involved in your query; in my experience it chooses correctly most of the time. I see from another post in this thread that your query is:
      select topic FROM table1 WHERE uri LIKE '$q'
      You can find out what indexes are used by MySQL in this query by running the command
      EXPLAIN SELECT topic FROM table1 WHERE uri LIKE 'something'
      where "something" is one of your parameters. You can see what indexes are defined on your table by running the command
      SHOW CREATE TABLE table1;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://484874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-09-20 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls