Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/how-to/databases-and-queries.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ A query vector for `vectorNeighbors` can be a numpy array or a list. This sectio

* `first()` returns the first row, or `None` when there is none, so `if db.query(...).first():` tests whether anything matched.
* `to_list()` materialises the whole result as a list of dicts, one Python dict per row. Use it for a small result, or when you need the whole result in memory; iterate when you stop early. For a large result, see <<reading-large-results>>.
* `to_json_list(batch_size=10_000)` returns the rows as a list of JSON-native dicts, the same on both builds. A `DATE` or `DATETIME` is a number of epoch milliseconds, a record id is its text, and every `DECIMAL` is a `float` whatever its scale, so `Decimal("3")` is `3.0` and one column has one Python type. A `float` keeps about 17 significant digits, so a `DECIMAL` with more digits is rounded: `to_list()` returns the `Decimal` with every digit.
* `to_json_list(batch_size=10_000)` returns the rows as a list of JSON-native dicts, the same on both builds. A `DATE` or `DATETIME` is a number of epoch milliseconds, with one exception: a date or datetime property that an openCypher `RETURN` gives as a column of its own is ISO text on both builds (`RETURN t.day` gives `+"2026-01-02"+` and `RETURN t.ts` gives `+"2026-01-02T03:04:05.678"+`), while the same values inside a list or a map are numbers (https://github.com/ArcadeData/arcadedb-python/issues/453[#453]). A record id is its text, and every `DECIMAL` is a `float` whatever its scale, so `Decimal("3")` is `3.0` and one column has one Python type. A `float` keeps about 17 significant digits, so a `DECIMAL` with more digits is rounded: `to_list()` returns the `Decimal` with every digit.
* `iter_json_batches(batch_size=10_000)` yields the rows as lists of JSON-native dicts, `batch_size` rows per list (the last may be shorter), with the same values as `to_json_list()`. On the native build `batch_size` bounds memory: the result set holds one reply of the cursor (2048 rows) and one batch at a time, and reads the next reply only when the next batch is asked for, so a large result is never held whole. On the JVM build a batch is serialised on the Java side one at a time. `to_list()`, `to_json_list()`, `to_dataframe()`, `to_columns()`, `to_arrow()` and `to_polars()` still hold the whole result, because they return it whole.
+
One laptop study on the native build, 1,000,000 rows read with `batch_size=10_000`, 10 clean pairs of this change against the previous behaviour; each figure is the ratio of the new value to the old one, so below 1 is lower. Peak RSS: 0.286 (95% interval 0.284 to 0.289). Time to the first batch: 0.010 (95% interval 0.009 to 0.010). Wall time of the whole read: 0.958 (95% interval 0.952 to 0.966). This is one machine and one result shape, not a speed promise.
Expand Down