Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2022-08-07 15:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found