5+ millions rows

Questions5+ millions rows
Dmitri asked 3 years ago

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
Abu Ghufran answered 3 years ago

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

17 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!