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
[Feature](Cloud) Support session variable disable_file_cache and enable_segment_cache in query (#37141)
Currently, whether to read from file cache or remote storage is
controlled by the BE config `enable_file_cache` in cloud mode.
This PR proposed to control the file cache behavior via session
variables when executing queries in cloud mode.
It's more convenient when have such a session variable, cache behavior
could be controlled per query/session without changing BE configs, such
as:
1. **Performance test**. Test the query performance when read from local
file cache or remote storage for queries.
2. **Data correctness**. Check if it's file cache issue for certain
tables or queries.
The read path has three kinds of caches: segment cache, page cache and
file cache.
| module | cache| BE config | session variable|
|------------|------|----------| ---- |
| Segment | segment cache | disable_segment_cache |
**enable_segment_cache** (supportted by this PR) |
| PageIO | page cache | disable_storage_page_cache | enable_page_cache |
| FileReader | file cache | enable_file_cache | **disable_file_cache**
(supportted by this PR) |
The modification of the PR:
- **enable_segment_cache**: add a new session variable
enable_segment_cache to control use segment cache or not.
- **disable_file_cache**: disable_file_cache was for write path in cloud
mode. It's supported for read path when executing queries in the PR.
With this PR, data is read from remote storage without cache:
```sql
set enable_segment_cache=false;
set enable_page_cache=false;
set disable_file_cache=true;
```
Co-authored-by: Gavin Chou <[email protected]>
0 commit comments