> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# atoti.Cube.shared_context

#### *property* Cube.shared\_context *: [MutableMapping](https://docs.python.org/3/library/collections.abc.html#collections.abc.MutableMapping)\[[str](https://docs.python.org/3/library/stdtypes.html#str), [bool](https://docs.python.org/3/library/functions.html#bool) | [int](https://docs.python.org/3/library/functions.html#int) | [float](https://docs.python.org/3/library/functions.html#float) | [str](https://docs.python.org/3/library/stdtypes.html#str)]*

Context values shared by all the users.

Context values can also be set at query time, and per user, directly from the UI.
The values in the shared context are the default ones for all the users.

* `queriesTimeLimit`

  The number of seconds after which a running query is cancelled and its resources reclaimed.
  Set to `-1` to remove the limit.
* `queriesResultLimit.intermediateLimit`

  The limit number of point locations for a single intermediate result.
  This works as a safe-guard to prevent queries from consuming too much memory, which is especially useful when going to production with several simultaneous users on the same server.
  Set to `-1` to remove the limit.
* `queriesResultLimit.transientLimit`

  Similar to *intermediateLimit* but across all the intermediate results of the same query.
  Set to `-1` to remove the limit.
* `queryExecution.disableRangeSharing`
  > Range sharing can be disabled to prevent heap memory overuse.
  > Range sharing is used when multiple queries with overlapping locations are executed concurrently.

### Example

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> import pprint
>>> df = pd.DataFrame(
...     columns=["City", "Price"],
...     data=[
...         ("London", 240.0),
...         ("New York", 270.0),
...         ("Paris", 200.0),
...     ],
... )
>>> table = session.read_pandas(
...     df,
...     keys={"City"},
...     table_name="shared_context example",
... )
>>> cube = session.create_cube(table)
>>> pprint.pp({**cube.shared_context})
{'queriesTimeLimit': '30',
 'queryExecution.disableRangeSharing': 'false',
 'queriesResultLimit.transientLimit': '10000000',
 'queriesResultLimit.intermediateLimit': '1000000'}
>>> cube.shared_context["queriesTimeLimit"] = 60
>>> cube.shared_context["queriesResultLimit.intermediateLimit"] = 5_000_000
>>> cube.shared_context["queriesResultLimit.transientLimit"] = 50_000_000
>>> cube.shared_context["queryExecution.disableRangeSharing"] = True
>>> pprint.pp({**cube.shared_context})
{'queriesTimeLimit': '60',
 'queryExecution.disableRangeSharing': 'true',
 'queriesResultLimit.transientLimit': '50000000',
 'queriesResultLimit.intermediateLimit': '5000000'}
```
