This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
bindings: UNIQUE_HASH for equality-only ids (#9169), COMPACTION_INTERVAL for hourly time series (#9166), across docs, source, tests, examples - #178
Merged
Conversation
… (UNIQUE_HASH for ids, COMPACTION_INTERVAL for hourly aggregates) An id that is only read, updated and deleted by equality gets UNIQUE_HASH (ArcadeData#9169, fixed in ArcadeData#9222, 26.10.1): docs snippets, examples 04 (Link.movieId), 21 and 26, and the create_index docstrings. UNIQUE stays where the key is also ordered (Movie.movieId in example 04). The queries guide gains an "Index choice for an id" paragraph with the maintainers' numbers and what we measured on 26.9.1 (old sorted hash layout, 2.5 to 6 times slower loads), and the schema API page follows it. Example 17 declares COMPACTION_INTERVAL 1 HOURS in both CREATE TIMESERIES TYPE statements, since every query it runs is an hourly bucket (ArcadeData#9166); the async executor page, the server guide and the example pages carry the pointer. New test: a UNIQUE_HASH id end to end (SQL and openCypher lookup, update and delete by id, EXPLAIN shows FETCH FROM INDEX, duplicate rejected). It passes on 26.9.1 and 26.10.1, so it has no version guard. The testing pages follow it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ubz3m6QXHESerCkehC1qgi
…age size (ArcadeData#9175) in Memory Planning, now that PR ArcadeData#9250 merged Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ubz3m6QXHESerCkehC1qgi
…y order, lookup_by_key is O(1) only for a hash index, hash NULL_STRATEGY ERROR is enforced from 26.10.1 Measured on 26.10.1 main (10 runs per arm on Temurin 21 and 25, 200,000 and 2,000,000 LONG ids, same answers): UNIQUE_HASH against UNIQUE answers SQL id = ? 1.5 to 2.3 times faster, an Index.get() hit 1.9 to 3.1 times, an UPDATE by id 1.04 to 1.13 times, a DELETE by id level, and inserts 1.14 to 1.23 times faster for shuffled ids but 9% to 16% slower for ascending ids. The known-issues sentence on hash indexes for identifiers now points at that rule. The hash null strategy note was checked on the 26.9.1 release (accepts null and missing keys) and on 3543960 (REBUILD INDEX over null rows fails and leaves the type without the index; deleting the rows first lets it rebuild). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ubz3m6QXHESerCkehC1qgi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #177.
bindings: apply the maintainers' index and time-series best practices (UNIQUE_HASH for ids, COMPACTION_INTERVAL for hourly aggregates)
Two answers from the ArcadeDB maintainers are now confirmed and the bindings follow them: an id that is only read, updated and deleted by equality gets a
UNIQUE_HASHindex (ArcadeData#9169, fixed in ArcadeData#9222, 26.10.1), and a time-series type whose main query is an hourly aggregate declaresCOMPACTION_INTERVAL 1 HOURSwithSHARDSleft at its default (ArcadeData#9166).The queries guide gains an "Index choice for an id" paragraph with the maintainers' numbers (hash inserts as fast as LSM or faster, point lookups about 3x faster, 200,000 entries), the rule for when to keep
UNIQUE(ranges andORDER BY) and when to keep an LSM index on a low-cardinality non-unique column (ArcadeData#9228), and what we measured on 26.9.1: the old sorted hash layout made a 200,000-id load 2.5 to 6 times slower thanUNIQUE, so on 26.9.1 an id you bulk load staysUNIQUE. The schema API page and thecreate_indexdocstrings show the hash form for an id and the LSM form for a key you also order by.Docs snippets that index an id or an email read only by equality now say
UNIQUE_HASH: the async executor, database, exceptions, server, transactions, vector, schema and import pages, the quickstart, the troubleshooting guide, the core database and transactions guides, and the Java coverage page. Examples 21 and 26 and theLink.movieIdindex of example 04 switch the same way.Movie.movieIdin example 04 staysUNIQUEbecause its test queriesORDER BY movieId, and the page says so. Example 17 declaresCOMPACTION_INTERVAL 1 HOURSin both of itsCREATE TIMESERIES TYPEstatements because every query it runs is an hourly bucket; the async executor page, the server guide and the example pages carry the pointer sentence.A new test,
test_unique_hash_index_serves_id_lookup_update_and_delete, covers the recommended path end to end: aUNIQUE_HASHindex on an id, a point lookup by SQL and by openCypher, an update and a delete by id,EXPLAINshowingFETCH FROM INDEX, and a rejected duplicate. It passes on the 26.9.1 wheel and on a 26.10.1 snapshot (only the insert speed differs), so it carries no version guard. The testing pages follow it.Left alone on purpose: every existing test that creates a
UNIQUEindex (they test the LSM unique constraint, restore, parallel insert and schema API paths), the partitioned parallel-insert paragraph that needs aUNIQUEindex, non-unique name and category indexes, the benchmark harness (a separate decision), and example 22 with its explicitSHARDS 4. Two practices wait for ArcadeData#9250 to merge: the page-cache share guidance (ArcadeData#9168) andarcadedb.indexDefaultPageSize(ArcadeData#9175).Verification: examples 04 (movielens-small), 17, 21 and 26 were run against a 26.10.1 snapshot before and after the change and print the same output apart from timings, the random index names, and
UNIQUE_HASHwhere an index kind is printed. The affected test files and the full suite were run on the same snapshot. pre-commit and bandit (src and tests at low/low, examples at medium/high) are clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ubz3m6QXHESerCkehC1qgi