Debian Codegraph @

doc/source/reference/commands/cache_limit.rst

raw
1 .. -*- rst -*-
2 .. Groonga Project
3
4 .. groonga-command
5 .. database: commands_cache_limit
6
7 ``cache_limit``
8 ===============
9
10 Summary
11 -------
12
13 ``cache_limit`` gets or sets the max number of query cache
14 entries. Query cache is used only by :doc:`select` command.
15
16 If the max number of query cache entries is 100, the recent 100
17 ``select`` commands are only cached. The cache expire algorithm is LRU
18 (least recently used).
19
20 Syntax
21 ------
22
23 This command takes only one optional parameter::
24
25 cache_limit [max=null]
26
27 Usage
28 -----
29
30 You can get the current max number of cache entries by executing
31 ``cache_limit`` without parameter.
32
33 .. groonga-command
34 .. include:: ../../example/reference/commands/cache_limit/get.log
35 .. cache_limit
36
37 You can set the max number of cache entries by executing ``cache_limit``
38 with ``max`` parameter.
39
40 Here is an example that sets ``10`` as the max number of cache
41 entries.
42
43 .. groonga-command
44 .. include:: ../../example/reference/commands/cache_limit/set.log
45 .. cache_limit 10
46 .. cache_limit
47
48 If ``max`` parameter is used, the return value is the max number of
49 cache entries before ``max`` parameter is set.
50
51
52 Parameters
53 ----------
54
55 This section describes all parameters.
56
57 ``max``
58 """""""
59
60 Specifies the max number of query cache entries as a number.
61
62 If ``max`` parameter isn't specified, the current max number of query
63 cache entries isn't changed. ``cache_limit`` just returns the current
64 max number of query cache entries.
65
66 Return value
67 ------------
68
69 ``cache_limit`` returns the current max number of query cache entries::
70
71 [HEADER, N_ENTRIES]
72
73 ``HEADER``
74
75 See :doc:`/reference/command/output_format` about ``HEADER``.
76
77 ``N_ENTRIES``
78
79 ``N_ENTRIES`` is the current max number of query cache entries. It
80 is a number.
81
82 See also
83 --------
84
85 * :doc:`select`