2023-10-17 23:36:14 +08:00
|
|
|
[discrete]
|
2023-06-06 00:38:55 +08:00
|
|
|
[[esql-limit]]
|
|
|
|
=== `LIMIT`
|
|
|
|
|
2023-11-06 15:42:13 +08:00
|
|
|
**Syntax**
|
2023-06-06 00:38:55 +08:00
|
|
|
|
|
|
|
[source,esql]
|
|
|
|
----
|
2023-11-06 15:42:13 +08:00
|
|
|
LIMIT max_number_of_rows
|
2023-06-06 00:38:55 +08:00
|
|
|
----
|
2023-09-26 16:12:23 +08:00
|
|
|
|
2023-11-06 15:42:13 +08:00
|
|
|
*Parameters*
|
|
|
|
|
|
|
|
`max_number_of_rows`::
|
|
|
|
The maximum number of rows to return.
|
|
|
|
|
|
|
|
*Description*
|
|
|
|
|
|
|
|
The `LIMIT` processing command enables you to limit the number of rows that are
|
|
|
|
returned. If not specified, `LIMIT` defaults to `500`.
|
|
|
|
|
|
|
|
A query does not return more than 10,000 rows, regardless of the `LIMIT` value.
|
|
|
|
You can change this with the `esql.query.result_truncation_max_size` static
|
|
|
|
cluster setting.
|
|
|
|
|
|
|
|
*Example*
|
|
|
|
|
|
|
|
[source,esql]
|
|
|
|
----
|
|
|
|
include::{esql-specs}/docs.csv-spec[tag=limit]
|
|
|
|
----
|