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
Copy file name to clipboardExpand all lines: content/develop/interact/search-and-query/best-practices/dev-to-prod-best-practices.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,20 +20,20 @@ RQE offers several configurable parameters that influence query results and perf
20
20
21
21
### 1. `TIMEOUT`
22
22
23
-
- Purpose: Limits the duration a query is allowed to execute.
23
+
- Purpose: limits the duration a query is allowed to execute.
24
24
- Default: 500 milliseconds.
25
25
- Behavior:
26
+
- Ensures that queries do not monopolize the main Redis thread.
26
27
- If a query exceeds the `TIMEOUT` value, its outcome is determined by the `ON_TIMEOUT` setting:
27
-
-`FAIL`: The query will return an error.
28
-
-`PARTIAL`: Partial results will be returned.
28
+
-`FAIL`: the query will return an error.
29
+
-`PARTIAL`: this setting will return the top results accumulated by the query until it timed out.
29
30
- Recommendations:
30
-
- Default behavior: Ensures that queries do not monopolize the main Redis thread.
31
-
- Caution: Be mindful when increasing `TIMEOUT`,<!-- especially in environments without QPF,--> as long-running queries can degrade overall system performance.
32
-
<!-- - With Query Performance Factor (QPF): If QPF (multi-threaded query execution) is enabled, the risks of increasing this value are mitigated, as queries execute against index memory using multiple threads.-->
31
+
- Caution: be mindful when increasing `TIMEOUT`,<!-- especially in environments without QPF,--> as long-running queries can degrade overall system performance.
32
+
<!-- - With Query Performance Factor (QPF): if QPF (multi-threaded query execution) is enabled, the risks of increasing this value are mitigated, as queries execute against index memory using multiple threads.-->
33
33
34
34
### 2. `MINPREFIX`
35
35
36
-
- Purpose: Sets the minimum number of characters required for wildcard searches.
36
+
- Purpose: sets the minimum number of characters required for wildcard searches.
37
37
- Default: 2 characters.
38
38
- Behavior:
39
39
- Queries like `he*` are valid, while `h*` would not meet the threshold.
@@ -45,13 +45,16 @@ RQE offers several configurable parameters that influence query results and perf
45
45
46
46
- Purpose: Defines the maximum number of expansions for a wildcard query term.
47
47
- Default: 200 expansions.
48
+
- Behavior:
49
+
- Expansions: when a wildcard query term is processed, Redis generates a list of all possible matches from the index that satisfy the wildcard. For example, the query he* might expand to terms like hello, hero, and heat. Each of these matches is an "expansion."
50
+
- This parameter limits how many of these expansions Redis will generate and process. If the number of possible matches exceeds the limit, the query may return incomplete results or fail, depending on the query context.
48
51
- Recommendations:
49
52
- Avoid increasing this parameter excessively, as it can lead to performance bottlenecks during query execution.
50
53
- If wildcard searches are common, consider optimizing your index to reduce the reliance on large wildcard expansions.
51
54
52
55
### 4. `DEFAULT_DIALECT`
53
56
54
-
- Purpose: Specifies the default query dialect used by [`FT.SEARCH`]({{< baseurl >}}/commands/ft.search) and [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate) commands.
57
+
- Purpose: specifies the default query dialect used by [`FT.SEARCH`]({{< baseurl >}}/commands/ft.search) and [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate) commands.
- Update the default to [**Dialect 4**]({{< relref "/develop/interact/search-and-query/advanced-concepts/dialects#dialect-4" >}}) for better performance and access to advanced features.
@@ -60,9 +63,9 @@ RQE offers several configurable parameters that influence query results and perf
60
63
## Testing
61
64
62
65
### 1. Correctness
63
-
-Ensure query results align with expected outcomes.
66
+
-Run a few test queries and check the results are what you expect.
64
67
- Use the following tools to validate and debug:
65
-
- Redis CLI: Use [`MONITOR`]({{< baseurl >}}/commands/monitor) or [profiling features]({{< relref "/develop/tools/insight#profiler" >}}) in Redis Insight to analyze commands.
68
+
- Redis CLI: use the [`MONITOR`]({{< baseurl >}}/commands/monitor) command or [profiling features]({{< relref "/develop/tools/insight#profiler" >}}) in Redis Insight to analyze commands.
66
69
-[`FT.PROFILE`]({{< baseurl >}}/commands/ft.profile): Provides detailed insights into individual query execution paths, helping identify bottlenecks and inefficiencies.
0 commit comments