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