# groonga - An open-source fulltext search engine and column store.

- 日本語版はこちら

### Navigation

- index
- next |
- previous |
- Groonga v4.0.2-145-gc632eed documentation »
- 8. Reference manual »
- 8.3. Command »

# 8.3.4. `cache_limit`

## 8.3.4.1. Summary

`cache_limit` gets or sets the max number of query cache entries. Query cache is used only by select command.

If the max number of query cache entries is 100, the recent 100 `select` commands are only cached. The cache expire algorithm is LRU (least recently used).

## 8.3.4.2. Syntax

`cache_limit` has one optional parameter:

    cache_limit [max=null]

## 8.3.4.3. Usage

You can get the current max number of cache entries by executing `cache_limit` without parameter.

Execution example:

    cache_limit
    # [[0, 1337566253.89858, 0.000355720520019531], 100]

You can set the max number of cache entries by executing `cache_limit` with `max` parameter.

Here is an example that sets `10` as the max number of cache entries.

Execution example:

    cache_limit 10
    # [[0, 1337566253.89858, 0.000355720520019531], 100]
    cache_limit
    # [[0, 1337566253.89858, 0.000355720520019531], 10]

If `max` parameter is used, the return value is the max number of cache entries before `max` parameter is set.

## 8.3.4.4. Parameters

This section describes all parameters.

### 8.3.4.4.1. `max`

It specifies the max number of query cache entries as a number.

If `max` parameter isn't specified, the current max number of query cache entries isn't changed. `cache_limit` just returns the current max number of query cache entries.

## 8.3.4.5. Return value

`cache_limit` returns the current max number of query cache entries:

    [HEADER, N_ENTRIES]

`HEADER`

> See Output format about `HEADER`.

`N_ENTRIES`

> `N_ENTRIES` is the current max number of query cache entries. It is a number.

## 8.3.4.6. See also

- select

### Navigation

- index
- next |
- previous |
- Groonga v4.0.2-145-gc632eed documentation »
- 8. Reference manual »
- 8.3. Command »