Searching throu 5+ millions rows is freezing
SELECT count(*) as c FROM (SELECT * FROM CLIENT WHERE 1=1 AND ( DESCRIPTION LIKE '%John%' )) pg_tmp
Is it possible change LIKE operator to CONTAINS? Is any others way to search throu greate data massive?
Thank you
1 Answers
Hi,
The like or contains operators may not perform well on large data set and it's database limitation.
You can change it to starts-with search and if the field 'description' has index, it will perform better.
With that grid column, you can change search operator by:
$col["searchoptions"]["sopt"] = array("bw"); // begins with
will make query like: John% (remove preceding %)
SELECT count(*) as c FROM (SELECT * FROM CLIENT WHERE 1=1 AND ( DESCRIPTION LIKE 'John%' )) pg_tmp
Your Answer