If user type keyword in search box I want engine to search in more than 4 column this take long time if can suggest another solution to fast this search as it search in more than 80,000 rows
$kay=$_GET['kay'];
<?php
$search_query = "select * from product where
sku LIKE '%$kay%'
or mfr LIKE '%$kay%'
or manufacturer LIKE '%$kay%'
or LongDesc LIKE '%$kay%')";
?>
The kind of search you have specified -- an OR
sequence of col LIKE '%value%'
clauses -- is the very slowest way anyone can imagine to search a MySQL table. Why? The promiscuous wildcard search LIKE x
where x
starts with %
can only be satisfied with a full scan.
Switch to FULLTEXT
search. You can read about it on the MySql documentation web site.
There was a recent article about an extension to PostgreSQL that exploits hundreds of GPU cores running in parallel to do searches; that might help too.