PHP + MySQL = Cache Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

PHP + MySQL = Cache Problem

Post by gotornot »

Hi All

I have a site that is taking a bunch of feeds from other sites, normalizing the data into a product file. I also have a "Google" like search engine that a user can use to searh this data and get desired results.

I have nearly 1m products and it takes 1 user only approximately 10 seconds to search the data even though its thoroughly indexed. I heard putting the data in cache would be far quicker.

Is this true?

The size of the data is just under 600mb so i have plenty of RAM.

If this is true can someone please point me in the right direction to upload it in the cache and search on it.

Many thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP + MySQL = Cache Problem

Post by requinix »

Caching only helps when you know what data you want to get. By definition, it can't help with a new search. (You could cache the search results for a query, though, but you still have to get the results.)

First let's take a look at that query. What is it? What's the output of an EXPLAIN on it?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: PHP + MySQL = Cache Problem

Post by Weirdan »

1m rows / 10 seconds - sounds like a full table scan to me, unless you have really slow server. I've just tried full table scan on a slow server on a table with 75M rows - it took about 45 seconds.
Post Reply