Skip to content

Commit c65f5ee

Browse files
authored
Merge pull request #182 from ArangoDB-Community/fillBlockCache
Added query option for avoiding fillBlockCache during queries.
2 parents 54d03c4 + 912090a commit c65f5ee

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arango/aql.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ def execute(
263263
stream: Optional[bool] = None,
264264
skip_inaccessible_cols: Optional[bool] = None,
265265
max_runtime: Optional[Number] = None,
266+
fill_block_cache: Optional[bool] = None,
266267
) -> Result[Cursor]:
267268
"""Execute the query and return the result cursor.
268269
@@ -345,6 +346,16 @@ def execute(
345346
it is killed. The value is specified in seconds. Default value
346347
is 0.0 (no timeout).
347348
:type max_runtime: int | float
349+
:param fill_block_cache: If set to true or not specified, this will
350+
make the query store the data it reads via the RocksDB storage
351+
engine in the RocksDB block cache. This is usually the desired
352+
behavior. The option can be set to false for queries that are
353+
known to either read a lot of data which would thrash the block
354+
cache, or for queries that read data which are known to be outside
355+
of the hot set. By setting the option to false, data read by the
356+
query will not make it into the RocksDB block cache if not already
357+
in there, thus leaving more room for the actual hot set.
358+
:type fill_block_cache: bool
348359
:return: Result cursor.
349360
:rtype: arango.cursor.Cursor
350361
:raise arango.exceptions.AQLQueryExecuteError: If execute fails.
@@ -364,6 +375,8 @@ def execute(
364375
options: Json = {}
365376
if full_count is not None:
366377
options["fullCount"] = full_count
378+
if fill_block_cache is not None:
379+
options["fillBlockCache"] = fill_block_cache
367380
if max_plans is not None:
368381
options["maxNumberOfPlans"] = max_plans
369382
if optimizer_rules is not None:

0 commit comments

Comments
 (0)