Skip to content

Bulk UPDATE and DELETE: statement, key loop, record-API loop, or UPSERT loop #360

Open

Description

@tae898

Problem

I want to know which bulk update and delete shape is cheapest, how the cost grows with N, and where the share sweep changes the answer.

It is one row of the bindings study list. It was held on stale pins and re-pins after the 26.12.1 wheels exist.

Priority: P3 (not on any deadline).

Acceptance

  • The dry run is clean and its report is written
  • The study runs and is scored
  • The docs recommend one shape per case with its figure

Results and the scorer output go in this issue as comments. Numbers are generated by script from the result files, never typed.

(Edited 2026-11-24: the study now measures on the 26.12.1 wheels, see #315.)

Activity

  1. added
    python
    performance
    on Nov 10, 2026
  2. added this to the 26.12.1 milestone on Nov 10, 2026
  3. modified the milestones: 26.12.1, 27.1.1 on Nov 21, 2026
  4. added
    enhancement
    on Dec 2, 2026
  5. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    Result of the full run of the bulk update and delete study on 26.12.1.dev2: 8 of 12 units are readable, 4 are WEAK and report nothing

    This is the result of the one full run, which finished on 2026-12-04. It ran on the 26.12.1.dev2 wheels of arcadedb (native) and arcadedb-jvm (the final 26.12.1 is not on PyPI yet), on one laptop with two pinned cores, with the rules of the kit's README written before the run. Each wheel is scored alone and the two are never compared. Nothing is asked of you here.

    What the wheels are. They were published on 2026-11-07 from bindings commit 4b8a5b1, and main is 225 commits ahead of it (checked on 2026-12-06). They lack, for example, #392 (on the JVM wheel insert_many sends typed columns, not JSON text) and #391 (the same for GraphBatch). I do not know whether any of the 225 commits changes the update and delete paths measured here, so I repeat the study on the final 26.12.1 wheels as a new run and treat these figures as the pre-release baseline.

    What was measured. The wall time of one way to change or delete half of the rows of a table of N documents (wall_s, the pattern plus the close), after which the database is reopened and the answer is checked. Arms: A one SQL statement in one transaction, B a SQL key loop (WHERE id = ?, transactions of 10,000), C a record-API loop (lookup_by_key plus modify() and save(), or delete(), transactions of 10,000). The two columns below are the median over 12 rounds of the per-round ratio of the arm to A, so above 1.000 the arm costs more than the single statement. The scorer's rule then names a recommendation. Run size: 754 runs, 696 scored (round 0, the warm-up, is dropped), 0 failed.

    wheel workload N B / A C / A recommendation by the rule
    native update 100,000 2.077 8.919 the single statement
    native delete 10,000 1.630 2.657 the single statement
    native delete 100,000 0.903 1.359 the SQL key loop
    native delete 1,000,000 0.153 0.232 the SQL key loop
    JVM update 100,000 2.081 1.453 the single statement
    JVM update 1,000,000 2.355 2.408 the single statement
    JVM delete 100,000 1.325 0.968 the record-API loop
    JVM delete 1,000,000 0.181 0.153 the record-API loop

    WEAK, so not read. A unit is WEAK when a gating comparison has fewer than 10 clean pairs or a 95% bootstrap interval wider than 0.10 times its median. Seven comparisons are WEAK, all with 12 clean pairs, so it is the width: native-upd-10000 B/A (width 0.25 of the median); native-upd-10000 C/A (width 0.25 of the median); native-upd-1000000 B/A (width 0.14 of the median); native-upd-1000000 C/A (width 0.14 of the median); jvm-upd-10000 B/A (width 0.12 of the median); jvm-upd-10000 C/B (width 0.13 of the median); jvm-del-10000 C/B (width 0.12 of the median). They fall in four units, native-upd-10000, native-upd-1000000, jvm-upd-10000, jvm-del-10000. By the README those units report nothing, so their figures are left out of the tables, and nothing is queued for them on dev2.

    Observed in the readable units (generated from the scorer's output, not inferred):

    • The A/A control (arm Z against A, the 100,000-row units) is inside 1.00 in all four: JVM delete 0.997 [0.980, 1.022]; JVM update 1.013 [0.985, 1.047]; native delete 1.000 [0.996, 1.002]; native update 0.999 [0.991, 1.015].
    • At N = 1,000,000 the statement costs the most per row on delete: native 237.31 us per touched row against 36.54 for the key loop, JVM 178.05 against 32.04.
    • The rule does not give one answer: it names the single statement, the record-API loop and the SQL key loop for different units.

    Inferred, not measured. Nothing here says why the statement costs more per row at 1,000,000 rows, and I did not test it. The docs recommendation (one shape per case, with its figure) is not written yet: it waits for the WEAK units and for the final wheels.

    Limits. One laptop, relative figures only. The kit has no throttle or neighbouring-lane rule, so a run that was throttled is not dropped. N = 10,000 and 1,000,000 carry only A, B and C, and every table has id as an INTEGER UNIQUE index and g as a NOTUNIQUE index. Peak memory and disk are in the output but not scored.

    Next: once the final 26.12.1 wheels are on PyPI (there is only 26.12.1.dev2 so far), I will re-pin the kit to them as a new kit (only its wheel pins change) and rerun, including the four WEAK units. The dev2 figures stay here as the pre-release baseline.

    All comparisons of the 8 readable units (median and 95% bootstrap interval of the per-round ratio, 10,000 resamples, seed 1)

    The figure is wall_s. The verdict word is the scorer's: "no difference" when the interval holds 1.00 or lies inside 0.97 to 1.03, else the arm with the lower time is named ("slower than the reference" means the first arm costs more than the second).

    wheel workload N pair figure median [interval] clean pairs verdict
    native update 100,000 B/A wall_s 2.077 [2.060, 2.109] 12 slower than the reference
    native update 100,000 C/A wall_s 8.919 [8.867, 9.171] 12 slower than the reference
    native update 100,000 D/A wall_s 2.098 [2.084, 2.144] 12 slower than the reference
    native update 100,000 E/A wall_s 2.359 [2.345, 2.435] 12 slower than the reference
    native update 100,000 C/B wall_s 4.326 [4.289, 4.349] 12 slower than the reference
    native update 100,000 D/B wall_s 1.012 [1.010, 1.022] 12 no difference
    native update 100,000 E/B wall_s 1.141 [1.136, 1.146] 12 slower than the reference
    native update 100,000 Z/A wall_s 0.999 [0.991, 1.015] 12 no difference
    native delete 10,000 B/A wall_s 1.630 [1.624, 1.703] 12 slower than the reference
    native delete 10,000 C/A wall_s 2.657 [2.644, 2.756] 12 slower than the reference
    native delete 10,000 C/B wall_s 1.627 [1.607, 1.644] 12 slower than the reference
    native delete 100,000 B/A wall_s 0.903 [0.890, 0.926] 12 faster than the reference
    native delete 100,000 C/A wall_s 1.359 [1.347, 1.400] 12 slower than the reference
    native delete 100,000 E/A wall_s 1.255 [1.235, 1.272] 12 slower than the reference
    native delete 100,000 C/B wall_s 1.505 [1.497, 1.528] 12 slower than the reference
    native delete 100,000 E/B wall_s 1.378 [1.373, 1.385] 12 slower than the reference
    native delete 100,000 Z/A wall_s 1.000 [0.996, 1.002] 12 no difference
    native delete 1,000,000 B/A wall_s 0.153 [0.152, 0.155] 12 faster than the reference
    native delete 1,000,000 C/A wall_s 0.232 [0.230, 0.234] 12 faster than the reference
    native delete 1,000,000 C/B wall_s 1.511 [1.503, 1.519] 12 slower than the reference
    JVM update 100,000 B/A wall_s 2.081 [2.017, 2.119] 12 slower than the reference
    JVM update 100,000 C/A wall_s 1.453 [1.393, 1.478] 12 slower than the reference
    JVM update 100,000 D/A wall_s 2.092 [2.021, 2.193] 12 slower than the reference
    JVM update 100,000 E/A wall_s 2.196 [2.060, 2.251] 12 slower than the reference
    JVM update 100,000 C/B wall_s 0.699 [0.684, 0.708] 12 faster than the reference
    JVM update 100,000 D/B wall_s 1.013 [0.984, 1.041] 12 no difference
    JVM update 100,000 E/B wall_s 1.049 [1.013, 1.076] 12 slower than the reference
    JVM update 100,000 Z/A wall_s 1.013 [0.985, 1.047] 12 no difference
    JVM update 1,000,000 B/A wall_s 2.355 [2.282, 2.419] 12 slower than the reference
    JVM update 1,000,000 C/A wall_s 2.408 [2.360, 2.461] 12 slower than the reference
    JVM update 1,000,000 C/B wall_s 1.012 [1.003, 1.037] 12 slower than the reference
    JVM delete 100,000 B/A wall_s 1.325 [1.246, 1.362] 12 slower than the reference
    JVM delete 100,000 C/A wall_s 0.968 [0.940, 0.985] 12 faster than the reference
    JVM delete 100,000 E/A wall_s 1.593 [1.513, 1.612] 12 slower than the reference
    JVM delete 100,000 C/B wall_s 0.741 [0.715, 0.764] 12 faster than the reference
    JVM delete 100,000 E/B wall_s 1.202 [1.152, 1.239] 12 slower than the reference
    JVM delete 100,000 Z/A wall_s 0.997 [0.980, 1.022] 12 no difference
    JVM delete 1,000,000 B/A wall_s 0.181 [0.175, 0.192] 12 faster than the reference
    JVM delete 1,000,000 C/A wall_s 0.153 [0.150, 0.159] 12 faster than the reference
    JVM delete 1,000,000 C/B wall_s 0.835 [0.825, 0.861] 12 faster than the reference
    Share sweep at N = 100,000 (microseconds per touched row at 1%, 10% and 100% of the rows, against the 50% statement)

    Figure us_per_row, ratio to arm A (the statement at 50%): above 1.000 costs more per touched row.

    wheel workload 1% 10% 100%
    native update 3.405 [3.168, 3.418] 1.013 [1.001, 1.036] 0.958 [0.948, 0.983]
    native delete 2.676 [2.608, 2.690] 1.202 [1.193, 1.217] 0.993 [0.988, 1.005]
    JVM update 12.469 [11.910, 13.134] 2.444 [2.291, 2.639] 0.712 [0.682, 0.745]
    JVM delete 10.549 [10.395, 10.979] 2.392 [2.288, 2.492] 0.871 [0.837, 0.890]
    Cost per touched row against N (median microseconds, over the kept rounds, information only, WEAK units left out)
    wheel workload arm N = 10,000 N = 100,000 N = 1,000,000
    native update A WEAK 11.27 WEAK
    native update B WEAK 23.32 WEAK
    native update C WEAK 100.14 WEAK
    native delete A 18.52 39.11 237.31
    native delete B 30.22 35.27 36.54
    native delete C 49.24 53.05 55.02
    JVM update A WEAK 23.69 8.88
    JVM update B WEAK 48.68 21.00
    JVM update C WEAK 33.63 21.33
    JVM delete A WEAK 43.29 178.05
    JVM delete B WEAK 55.34 32.04
    JVM delete C WEAK 41.81 26.86
  6. added
    jvm
    native
    on Dec 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementjvmnativeperformancepython

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions