5+ millions rows

Questions5+ millions rows
Dmitri asked 4 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 4 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

9 + 14 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?