in reply to Need faster MySql data fetching with perl DBI

I've found that if the data is in one or all of the searched tables the search is fast. However, when if even one of the tables being searched doesn't contain the item I need, it is slow.

You seem to be contradicting yourself. If you search for data in two tables, don't find it in the first, but find it in the second, is the search fast, or is it slow?

What is the nature of the data you are searching for (e.g., is it keywords, part numbers, or something like that), and do you have that field indexed? If not, then you're doing a complete table scan for each search, which is a very poor approach to doing searches over a large search space.

  • Comment on Re: Need faster MySql data fetching with perl DBI

Replies are listed 'Best First'.
Re^2: Need faster MySql data fetching with perl DBI
by shaolindoman (Acolyte) on Jul 16, 2004 at 14:38 UTC
    Well you all, I must thank you once again. I stayed up reading about indexes and this morning I implemented them for all of my WHERE clauses. Wouldn't you know, that 20 to 25 second search I was talking about, well it is down to basically nothing now. It's instant on the website. Thanks so much for all the help.
      Now you better read up on MySQL security. If you didn't know about indexes, then chances are that you don't know about database security either.