You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SELECT/DELETE/count on a LIGHTWEIGHT edge type answer zero: the scan reads a bucket that by construction holds nothing #7477
Reported as discussion #7473: a 4.2M-vertex / 125M-row bulk load through GraphImporter into a CREATE EDGE TYPE CITE LIGHTWEIGHT logged Import complete: 4,243,018 vertices, 75,539,070 edges, and Studio then showed EDGES(0) / CITE 0 with select from CITE returning nothing.
The importer is not the problem
GraphBatch already honours the type's LIGHTWEIGHT declaration whatever its deprecated per-batch withLightEdges flag says, and the edges were connected: a GraphImporter run over a LIGHTWEIGHT edge source produces a graph whose vertices carry the edges and whose traversals return them.
What actually answered zero
A lightweight edge is a pair of pointers inside the two vertices and allocates no record, so the edge type's bucket is empty by construction - ALTER TYPE ... LIGHTWEIGHT is refused on a type that holds records, so it can never be anything else. Every read path that resolves edges by type name rather than by walking a vertex therefore answered zero on a graph holding 75 million of them:
SELECT FROM CITE - a bucket scan of a bucket that cannot hold anything.
SELECT count(*) FROM CITE - countType() counts records, of which there are none.
DELETE FROM CITE - silently deleted nothing.
SELECT FROM CITE WHERE @rid = ..., index and indexed-function plans - all address records that do not exist.
Studio's sidebar badge and type detail - printed that record count as the type's size, next to an import that had just reported 75M edges.
SELECT FROM schema:types never emitted lightweight/bidirectional/unique, so nothing downstream could tell that the 0 was by design. RemoteSchema has always read those three keys, so every edge type reached a remote client as a plain bidirectional non-unique one.
The Cypher planner already knew about the trap and declines its count push-down on such a type (#5071); SQL had no equivalent guard anywhere.
Fix
Scan the vertices that hold the edges when the target type (or a subtype) is lightweight, and keep every count consistent with what that scan returns.
Not covered
A type whose LIGHTWEIGHT declaration was later lifted holds both shapes and is not declared lightweight any more, so its surviving lightweight entries stay reachable only by traversal. TRAVERSE ... FROM <lightweight type> and the MATCH root-alias cost estimate still read the record count.
What was wrong: a LIGHTWEIGHT edge is stored as a pair of pointers inside its two vertices - it has no record of its own. Every query that asked for the edges by type name looked in the place where records live, found it empty, and answered zero. So a graph holding millions of edges reported none.
What works now:
SELECTFROM CITE -- returns the edgesSELECTcount(*) FROM CITE -- agrees with the aboveDELETEFROM CITE -- actually deletes them (it used to do nothing)
Studio also labels such a type LIGHTWEIGHT instead of showing it as 0, and remote clients now see the type's real flags.
Two things to know:
SELECT count(*) on a LIGHTWEIGHT edge type is no longer instant. There is no stored count that can be right, so it reads the graph. A warning in the server log tells you when this gets expensive.
If you declared an edge type LIGHTWEIGHT and thought your data had not loaded, it almost certainly had - upgrade and query it again.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
fix(#7477): count through the same walk, and check the walk's ACL per…
fix(#7477): gate the walk on the subtypes it can emit, explicitly
fix(#7477): warn when a lightweight-edge query walks a large vertex set
chore(#7477): restore alphabetical import order
fix(#7477): report a command warning at every occurrence when asked to
fix(#7477): don't fail a query over the size lookup that only feeds a…
docs(#7477): say why the lightweight branch drops effectiveClusters
perf(#7477): size the warning off the page count, not a syscall per b…
docs(#7477): say why countEdgesOf reading its own instance needs no lock
8 remaining items
fix(#7477): refuse TRUNCATE TYPE on a lightweight edge type
Merge pull request #7478 from ArcadeData/fix/7473-graphimporter-light…
lvca commentedon Sep 12, 2026
Fixed in 26.10.1 (PR #7478).
What was wrong: a
LIGHTWEIGHTedge is stored as a pair of pointers inside its two vertices - it has no record of its own. Every query that asked for the edges by type name looked in the place where records live, found it empty, and answered zero. So a graph holding millions of edges reported none.What works now:
Studio also labels such a type
LIGHTWEIGHTinstead of showing it as0, and remote clients now see the type's real flags.Two things to know:
SELECT count(*)on a LIGHTWEIGHT edge type is no longer instant. There is no stored count that can be right, so it reads the graph. A warning in the server log tells you when this gets expensive.TRAVERSEandTRUNCATE TYPEon such a type now return an error instead of quietly doing nothing. UseSELECT/DELETE FROMin the meantime - tracked in TRAVERSE on a LIGHTWEIGHT edge type: roots on an empty bucket, and its dedup collapses the whole type into one edge #7480 and TRUNCATE TYPE on a LIGHTWEIGHT edge type deletes nothing (now refuses); scanType() bypasses the vertex walk #7481.If you declared an edge type
LIGHTWEIGHTand thought your data had not loaded, it almost certainly had - upgrade and query it again.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(#7566): mark a sidebar section total as a lower bound when it hol…
fix(ArcadeData#7477): scan the vertices for a LIGHTWEIGHT edge type, …
fix(#7566): mark a sidebar section total as a lower bound when it hol…
fix: TRUNCATE on a LIGHTWEIGHT edge type no longer bypasses the UNSAF…
fix: TRUNCATE TYPE on a LIGHTWEIGHT edge type now deletes instead of …
fix: TRAVERSE now reaches LIGHTWEIGHT edge types without collapsing s…
docs(test): unpick a run-on phrase in the #7477 truncate fixture's ja…
fix(sql): the TRUNCATE TYPE guard names the type that holds the recor…
fix(sql): count a LIGHTWEIGHT descendant's own edges, not its subtree…
fix(sql): count a LIGHTWEIGHT descendant's own edges, not its subtree…