Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Optimizing a MySQL Query

by lhoward (Vicar)
on Aug 23, 2001 at 01:40 UTC ( [id://107157]=note: print w/replies, xml ) Need Help??


in reply to Optimizing a MySQL Query

  1. use DBI placeholders... (very rough code below)
    my $sth=$dbh->prepare_cached("select sitename, url, country, language, + listing, description from main where category=? and sitename like ?" +); $sth->execute($category,$letter);
  2. Make sure your DB has good indexes on category and sitename.

Replies are listed 'Best First'.
Re: Re: Optimizing a MySQL Query
by Cine (Friar) on Aug 23, 2001 at 01:56 UTC
    You add indexes in mysql by writing create index indexname ON main (category) in the mysql program... See CREATE INDEX

    T I M T O W T D I

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found