Hi. Can someone tell the difference between below ...
# troubleshooting
h
Hi. Can someone tell the difference between below two filters?
text_match(backend_name,'/perf/')
and
REGEXP_LIKE(backend_name,'perf')
What should be the equivalent
text_match
filter for
REGEXP_LIKE(backend_name,'perf')
? Thanks
m
@Atri Sharma ^^
h
Hi @Atri Sharma , Can u help pls.
a
Looking within the hour
👍 1
Hi @harnoor, apologies for the delay.
text_match(backend_name, 'perf')
should work well? Assuming you are looking to match only the term.
Also, I am assuming you have text index created on
backend_name
?
h
yes text index is created. I tried
text_match(backend_name, 'perf')
too, but i see no results while using the same. Query 1:
Copy code
Select distinct(backend_name) FROM backend_entity_view WHERE regexp_like(backend_name,'perf')
Result 1:
Copy code
<http://mock-go.int.perf.in|mock-go.int.perf.in>
perf.cache.np.vpc
Query 2:
Copy code
Select distinct(backend_name) FROM backend_entity_view WHERE text_match(backend_name,'perf')
Result 2:
Copy code
No Record(s) found
However, results are same when I use
text_match(backend_name,'/.*perf.*/')
.
a
Ah, so you are not looking to match the term, but the entire document. So, FST indices will index individual tokens (so you have 'perf' as a token). Whereas the text index will map to the entire document (so what you are saying is that give me any document which has 'perf' as a substring)
So for FST index, its a term query, vs for the text index, its a regex query. Note that regex will be a bit more expensive
h
Thanks for the answer. Regarding the right configuration for speeding up
REGEXP_LIKE()
i am still not clear though as I could not find right config on pinot docs. Basically we want to speed up all the queries that give me any document which has ‘perf’ or any string as a substring. I see this config on github https://github.com/apache/pinot/pull/6120#issue-717507183 . also these config. Can you pls suggest the best config? Started a new thread here - https://apache-pinot.slack.com/archives/C011C9JHN7R/p1657570231571219