Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Optimizing a MySQL Query

by lhoward (Vicar)
on Aug 23, 2001 at 01:40 UTC ( #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
Node Status?
node history
Node Type: note [id://107157]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2019-08-21 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?