Fulltext Search Overload on MYSQL Database

Discussion in 'MySQL' started by pushpinderbagga, May 5, 2009.

  1. #1
    Hello,

    greetings to all members here... I am new and this is my first share on DP.

    Actually I am making a bookmarking site and intend to show related stories under my story...

    lets take this by an example

    I have structured the application into tables with 10000 records each
    each table for example has a link, title, text, tags fields

    Now for example I have 12000 stories lined up in my database.
    I have added fulltext index in the (tags, title and text) columns of both tables

    table_1 containing 10K records
    and table_2 containing 2K records

    Now if I search related stories from the database as

    
    $query = "SELECT *,
    			MATCH(title, text, tags) AGAINST('".stripslashes(clean_text($key_1))."') AS score
    			FROM $query_dup		
              WHERE MATCH(title, text, tags) AGAINST('".stripslashes(clean_text($key_1))."') ORDER BY score DESC LIMIT 2";
    
    
    PHP:
    query_dup : table_1 table_2
    key_1 is the (title+text) concatenated string

    it return the results...

    my question is that as the database size increases and tables also increase

    query_dup will become table_1 table_2 table_3 table_4 etc

    will this query slow down and put load on the database and what can I do to decrease this load... any modifications to the match against query or what else...
     
    pushpinderbagga, May 5, 2009 IP