mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
Use **Fast Mode** when dealing with thousands of fields. It retrieves
the first N fields for a quicker response.
Enable it through this configuration:
```
ZO_FAST_MODE_NUM_FIELDS=50
ZO_FAST_MODE_STRATEGY=first/last/both
```
And use the search API:
```json
{
"query": {
"sql": "select * from default ",
"start_time": 1709711116396000,
"end_time": 1709712016396000,
"from": 0,
"size": 250,
"sql_mode": "full",
"fast_mode": true
}
}
```
When the backend identifies a request:
- Using `fast_mode`
- With an `SQL` prefix of `select *`
- Where schema fields exceed `ZO_FAST_MODE_NUM_FIELDS`
It will then rewrite the `SQL` to `select f1,f2,f3`, where 'fn'
represents the first 'n' fields from schema. The value of 'n' is
determined by `ZO_FAST_MODE_NUM_FIELDS`.
In the end you can set `ZO_FAST_MODE_STRATEGY=first/last/both` to
control the order for pickup fields from schema.
---------
Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>