From d39277217d19800f4b8e08d6fbff4b4d0f3d4cc0 Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Sun, 22 Nov 2026 18:49:52 +0900 Subject: [PATCH] Docs: the EXPORT DATABASE settings of engine 26.12.1, and a shorter pre-fix measurement in bulk-loads (closes #380, refs #365) import-export.adoc, "The SQL EXPORT DATABASE": from engine 26.12.1 the WITH clause reads the overwrite value (true or false only, false keeps an existing file), refuses a setting name it does not know (file and f included) and an empty includeTypes, excludeTypes or includeRecords list, and has two new settings, compressionLevel (0 to 9, default 6) and compressionThreads (-1 to 256, default -1 = half the processors, at most 8, at least 1; 0 = the old single-threaded gzip). The text says what 26.11.1 and earlier did, and that db.export_database() has no argument for the two compression settings. Each statement is read from the engine at ArcadeData/arcadedb 0c7117f4ad (ExporterSettings, ExportDatabaseStatement, AbstractExporterFormat, ParallelDeflater.autoThreads, and the tests Issue11523ExportOverwriteSettingTest and Issue11539ExportCompressionSettingsTest) and from the 26.11.1 tag for the old behaviour. It is prose only: the page tests run on engine 26.11.1 and on the snapshot, and the behaviour differs between them. bulk-loads.adoc, "Graph batches next to deletes": the pre-fix measurement is shorter now that the fix ships in 26.11.1. The table has one row for each way of writing the edges and one column for each package; every bucket size is kept, the four live-edge counts became their range. The two paragraphs after it are unchanged. --- .../modules/ROOT/pages/how-to/bulk-loads.adoc | 22 +++++-------------- .../ROOT/pages/how-to/import-export.adoc | 15 +++++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/docs/modules/ROOT/pages/how-to/bulk-loads.adoc b/docs/modules/ROOT/pages/how-to/bulk-loads.adoc index 099184fc..4b176056 100644 --- a/docs/modules/ROOT/pages/how-to/bulk-loads.adoc +++ b/docs/modules/ROOT/pages/how-to/bulk-loads.adoc @@ -246,36 +246,24 @@ The measurement is a laptop A/B on the `arcadedb` (native) wheel, one fresh proc NOTE: *Fixed in ArcadeDB 26.11.1.* Before 26.11.1, a graph batch did not reuse the space of deleted edges (https://github.com/ArcadeData/arcadedb/issues/10746[ArcadeData/arcadedb#10746]). The engine wrote the edge records of each `graph_batch()` flush onto new pages and never looked at the free space that deletes left on older pages, so the edge bucket gained one 64 KiB page per flush while the live data stayed flat. From 26.11.1 (https://github.com/ArcadeData/arcadedb/pull/10836[ArcadeData/arcadedb#10836]) each edge goes where an ordinary insert would put it while an existing page has room, and only the rest of a flush goes onto new pages, so a large import stays as fast as before. The 26.11.1 packages ship this fix. -On engine 26.10.2, a one-off bulk load is not affected. The workloads that are affected call `graph_batch()` again and again on a type that also sees deletes, for example a sliding window that adds a small batch and deletes the oldest one. +Only an engine older than 26.11.1 is affected, and only a workload that calls `graph_batch()` again and again on a type that also sees deletes, for example a sliding window that adds a small batch and deletes the oldest one. A one-off bulk load is not affected. -The measurement below ran on engine 26.10.2: a sliding window of 60 rounds for 240 seconds on each package. Each round wrote 30 vertices and about 90 edges and deleted the oldest round with `DELETE FROM Node`, so the live edge count stayed flat. The delete order does not matter: deleting the edges before the vertices gave the same growth. +The measurement on engine 26.10.2 was a sliding window of 60 rounds for 240 seconds on each package. Each round wrote 30 vertices and about 90 edges and deleted the oldest round with `DELETE FROM Node`, so the live edge count stayed flat (5,252 to 5,269 edges at the end of the four runs). Deleting the edges before the vertices gave the same growth. The table gives the size of the edge bucket at the end, in MiB. -[cols="3,2,2,2"] +[cols="3,1,1"] |=== -| How the edges were written | Package | Live edges at the end | Edge bucket at the end (MiB) +| How the edges were written | `arcadedb` (native) | `arcadedb-jvm` | `graph_batch()`, one block for each round -| `arcadedb` (native) -| 5,261 | 329.00 - -| `graph_batch()`, one block for each round -| `arcadedb-jvm` -| 5,257 | 456.62 | SQL `CREATE VERTEX` and `CREATE EDGE`, one transaction for each round -| `arcadedb` (native) -| 5,252 | 0.25 - -| SQL `CREATE VERTEX` and `CREATE EDGE`, one transaction for each round -| `arcadedb-jvm` -| 5,269 | 0.25 |=== -An engine-level Java run of the same shape confirms the split: after 2,000 rounds the batch had 2,000 edge pages (125.0 MiB), and `newEdge` in an ordinary transaction had 4 (0.3 MiB). The cost is disk space: in the same runs a scan of the edge type and a two-hop query did not slow down while the bucket grew. +An engine-level Java run of the same shape gave the same split: after 2,000 rounds the batch had 2,000 edge pages (125.0 MiB), and `newEdge` in an ordinary transaction had 4 (0.3 MiB). The cost was disk space only: in the same runs a scan of the edge type and a two-hop query did not slow down while the bucket grew. The engine-level Java run, repeated on the merge of the fix, kept the batch's edge bucket at 4 pages after 2,000 rounds, the same as `newEdge` in ordinary transactions, against 2,000 pages on its parent (https://github.com/ArcadeData/arcadedb/issues/10746#issuecomment-6462354150[verification on #10746]). diff --git a/docs/modules/ROOT/pages/how-to/import-export.adoc b/docs/modules/ROOT/pages/how-to/import-export.adoc index a1645d5b..ac3eaf88 100644 --- a/docs/modules/ROOT/pages/how-to/import-export.adoc +++ b/docs/modules/ROOT/pages/how-to/import-export.adoc @@ -332,6 +332,21 @@ OK EXPORT DATABASE file://nightly.jsonl.tgz ---- +// The two blocks of text below, on the WITH settings, are read from the engine source (ExporterSettings, ExportDatabaseStatement, AbstractExporterFormat, ParallelDeflater.autoThreads) and from its tests Issue11523ExportOverwriteSettingTest and Issue11539ExportCompressionSettingsTest. No test of this repository pins them: the behaviour differs between engine 26.11.1 and 26.12.1. + +A `WITH name = value, ...` clause after the file name passes settings to the exporter. What the clause accepts changes with engine 26.12.1 (https://github.com/ArcadeData/arcadedb/pull/11524[ArcadeData/arcadedb#11524]). `SELECT version()` gives the engine of your wheel. Where the text below says refused, the statement raises `ArcadeDBError`. + +* `overwrite`: from 26.12.1 the value is read, and it must be `true` or `false`. `WITH overwrite = false` keeps an existing file and the export is refused, the same as when you leave the setting out. Any other value, such as `'yes'` or `1`, is refused. On 26.11.1 and earlier the value was ignored: `WITH overwrite = false` replaced an existing file, as `WITH overwrite = true` does. +* A setting name that the exporter does not know: from 26.12.1 it is refused, and a name close to a known one gets a hint (`overwite` gives "Did you mean 'overwrite'?"). The known names are `format`, `overwrite`, `includeTypes`, `excludeTypes`, `includeRecords`, `verboseLevel`, `compressionLevel`, and `compressionThreads`. `file` and `f` are not among them, so the clause cannot send the export to another file. On 26.11.1 and earlier an unknown name was accepted and did nothing, and `file` or `f` replaced the target. +* An empty list: from 26.12.1 `includeTypes`, `excludeTypes`, and `includeRecords` refuse a value without an entry, such as `''` or `','`. + +Engine 26.12.1 also adds two settings for the gzip compression of the export file (https://github.com/ArcadeData/arcadedb/pull/11540[ArcadeData/arcadedb#11540]): + +* `compressionLevel` is the deflate level, from `0` (stored, no compression) to `9` (smallest). The default is `6`, the level of every export before the setting existed. +* `compressionThreads` is the number of threads that compress. The default, `-1`, is automatic: half the processors of the machine, at most 8 and at least 1. `0` is the single-threaded gzip that 26.11.1 and earlier used, and a number up to `256` is a pool of that size. + +A value outside these ranges is refused before anything is written. With every value the file is one standard gzip stream that `IMPORT DATABASE` reads back. `db.export_database(...)` has no argument for either setting, so on engine 26.12.1 it exports with the two defaults, and the statement is the way to set them. On 26.11.1 and earlier the statement accepts both names and they do nothing, like any unknown name. + An open transaction does not survive this statement. The engine rolls back every transaction of your thread before it exports, so rows that you wrote in it and did not commit are gone, and `db.is_transaction_active()` is `False` afterwards. Commit before you export, with this statement and with `db.export_database(...)`. The Python call does not share the folder rule of the statement: it accepts an absolute path. == Exporting a query to CSV