You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This query from ClickBench is heavily bottlenecked by our regex performance: MATCH (h:hits) WHERE h.Title =~ '.*Google.*' AND NOT h.URL =~ '.*\\.google\\..*' AND h.SearchPhrase <> '' RETURN h.SearchPhrase, MIN(h.URL), MIN(h.Title), COUNT(*) AS c, COUNT(DISTINCT h.UserID) ORDER BY c DESC LIMIT 10; (not that the original query uses a regex match, but we don't have a LIKE operator original sql query for reference).
See #4881 (comment): it takes 17s with the regex match compared to ~2.5s using contains instead.
Performance profiling shows that about 67% of the runtime is spent repeatedly compiling the regex (and a further 4% destroying the regex afterwards), despite it being the same each time.
Being able to compile the regex once and re-use it would speed things up significantly.
The text was updated successfully, but these errors were encountered:
Description
This query from ClickBench is heavily bottlenecked by our regex performance:
MATCH (h:hits) WHERE h.Title =~ '.*Google.*' AND NOT h.URL =~ '.*\\.google\\..*' AND h.SearchPhrase <> '' RETURN h.SearchPhrase, MIN(h.URL), MIN(h.Title), COUNT(*) AS c, COUNT(DISTINCT h.UserID) ORDER BY c DESC LIMIT 10;
(not that the original query uses a regex match, but we don't have aLIKE
operator original sql query for reference).See #4881 (comment): it takes 17s with the regex match compared to ~2.5s using
contains
instead.Performance profiling shows that about 67% of the runtime is spent repeatedly compiling the regex (and a further 4% destroying the regex afterwards), despite it being the same each time.
![Image](https://private-user-images.githubusercontent.com/8703943/412056848-a343c7e5-7a14-4e2f-929e-201a29a1c84d.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MDI2NDgsIm5iZiI6MTczOTcwMjM0OCwicGF0aCI6Ii84NzAzOTQzLzQxMjA1Njg0OC1hMzQzYzdlNS03YTE0LTRlMmYtOTI5ZS0yMDFhMjlhMWM4NGQuc3ZnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMTAzOTA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTU1NzAzNmEzMTljOGFkNDU1ZDJkY2Y3ZmVkZGQwOWIxNjJjNTY3MzAxMWU2YmVjZWE5NGFjZWUwMWQ5OTI5NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Zg9VU_q02-2MfQEmzeZB-gcHxY9JAktgPpfcjNY975Q)
Being able to compile the regex once and re-use it would speed things up significantly.
The text was updated successfully, but these errors were encountered: