Speed Up My Database Query

Speed Up My Database Query
My current script takes around 30 seconds to output the results.
I need to speed this up.

Reason for this long query time is the size of the table (12GB – 2.5M enteries).

I need a function to do the following:

– A user query the database to get a new article, based on one or more keywords ($keywords = keyword1,keyword no 2,keyword3 etc).
– The article is being pulled from table_articles.
– The article title or keywords need to match atleast one of the words in $keywords ($keywords = keyword1,keyword no 2,keyword3 etc).
– Everytime a user receive an article, then I put the article ID and user ID in a seperate table. The user only get articles which he have not received before (which means, the script need to check the other table to see if he already received this article before).

Table: table_articles (table containing all articles)
id,title,body,category,keywords (each keyword in seperated by a comma “,”)

Table: table_publishlist (table contain data of articles the user already received)
id,article_id,user_id,publishdate

You will not get access to my database.
You need to use your own test database etc.
Need to be done in PHP.

Leave a Reply

Your email address will not be published.