Mysql doesn't use primary index

Thank you very much for your replies. I’ve moved MySQL to another server. Now it’s much more faster and it’s CPU usage is max 50%.

The problem seems about sorting queries. After replacing ORDER BY news_date to ORDER BY news_id slow queries decreased. As I need to sort queries by date this won’t be an absolute solution. I’m still looking for a batter way.

Thank you so much again.

You could check another thing, that query with 25 latest news is te major one, so:

  1. fetch 24 latest rows (A)
  2. insert new row into news table (B)
  3. put A+B into static file
  4. show that file to the users
    That would give a breath to the mysql.

I use static files based caching for home page. But seems that it’s not enough. I’ll start caching other most used parts of the site starting with query you suggest.

Thanks.

I appreciate the concern which is been rose. The things need to be sorted out because it’s not about the individual but it can be with everyone

john

Office Jobs
Jobs in the Office
Office Jobs Advice
Information for Office Jobs

Office Jobs