Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2005
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Too many rows for mysql ?

    Hi,

    I have a large table in mySQL (5 million rows), version 4.1.11

    I have the following SQL

    SELECT DISTINCT p.product_id, (IF (p.id_from_import = 'remote',8,1) + IF(p.model = 'remote',4,1) + IF (p.source = 'remote',2,1)) as Relevancy FROM product_search p WHERE p.deleted = 'N' AND MATCH (p.search_field) AGAINST ('+remote*' IN BOOLEAN MODE)

    Problem is this is taking about 30 seconds to return the records, can anyone think how i can make it better ?

    Thanks

  • #2
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    It is the number of if's you are running. If you can cut them back, or do them seperately and pass them to the final query im pretty sure everything will speed up.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •