GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Delete of edge uses wrong index if many edges are present · Issue #2092 · ArcadeData/arcadedb

Delete of edge uses wrong index if many edges are present #2092

New issue
Copy link
New issue
Copy link
Closed
Bug
Closed
Delete of edge uses wrong index if many edges are present#2092
Bug
Copy link
Assignees
lvca
Milestone
26.2.1

Description

@achim-haeberle-fnt
achim-haeberle-fnt
opened on Mar 25, 2025
Issue body actions

ArcadeDBVersion: 25.3.1

Preconditions:

  • Up and running ArcadeDB server with available empty database

Steps to reproduce:

  • create the following schema:
    SQL: CREATE VERTEX TYPE zone if not exists;
    SQL: CREATE PROPERTY zone.id if not exists STRING;
    SQL: CREATE VERTEX TYPE device if not exists ;
    SQL: CREATE PROPERTY device.id if not exists STRING;
    SQL: CREATE EDGE TYPE zone_device if not exists ;
    SQL: CREATE PROPERTY zone_device.from_id if not exists STRING;
    SQL: CREATE PROPERTY zone_device.to_id if not exists STRING;
    SQL: CREATE PROPERTY zone_device.status_action if not exists INTEGER;
    SQL: CREATE INDEX if not exists ON zone_device (from_id, to_id,status_action) UNIQUE;
    SQL: CREATE INDEX if not exists ON zone_device (from_id) NOTUNIQUE;
    SQL: CREATE INDEX if not exists ON zone_device (to_id) NOTUNIQUE;

  • add about 1 million edges (not sure at which number it starts failing, works with 100.000)

  • try to delete one record via SQL :DELETE FROM zone_device WHERE from_id='zone1';

actual behaviour:
An exception occurs as the composite index seems to be used instead of the dedicated one

java.lang.IllegalArgumentException: key is composed of 1 items, while the index defined 3 items
at com.arcadedb.index.lsm.LSMTreeIndexAbstract.lookupInPage(LSMTreeIndexAbstract.java:261)
at com.arcadedb.index.lsm.LSMTreeIndexCompacted.newIterators(LSMTreeIndexCompacted.java:264)
at com.arcadedb.index.lsm.LSMTreeIndexCursor.(LSMTreeIndexCursor.java:90)
at com.arcadedb.index.lsm.LSMTreeIndexMutable.lambda$range$1(LSMTreeIndexMutable.java:202)
at com.arcadedb.utility.RWLockContext.executeInReadLock(RWLockContext.java:65)
at com.arcadedb.index.lsm.LSMTreeIndexMutable.range(LSMTreeIndexMutable.java:202)
at com.arcadedb.index.lsm.LSMTreeIndex.lambda$range$5(LSMTreeIndex.java:344)
at com.arcadedb.utility.RWLockContext.executeInReadLock(RWLockContext.java:65)
at com.arcadedb.index.lsm.LSMTreeIndex.range(LSMTreeIndex.java:344)
at com.arcadedb.index.TypeIndex.range(TypeIndex.java:91)
at com.arcadedb.query.sql.executor.FetchFromIndexStep.init(FetchFromIndexStep.java:342)
at com.arcadedb.query.sql.executor.FetchFromIndexStep.processAndBlock(FetchFromIndexStep.java:287)
at com.arcadedb.query.sql.executor.FetchFromIndexStep.init(FetchFromIndexStep.java:212)
at com.arcadedb.query.sql.executor.FetchFromIndexStep.init(FetchFromIndexStep.java:196)
at com.arcadedb.query.sql.executor.FetchFromIndexStep.syncPull(FetchFromIndexStep.java:84)
at com.arcadedb.query.sql.executor.GetValueFromIndexEntryStep$1.fetchNextItem(GetValueFromIndexEntryStep.java:98)
at com.arcadedb.query.sql.executor.GetValueFromIndexEntryStep$1.hasNext(GetValueFromIndexEntryStep.java:69)
at com.arcadedb.query.sql.executor.FilterByTypeStep$1.fetchNextItem(FilterByTypeStep.java:59)
at com.arcadedb.query.sql.executor.FilterByTypeStep$1.hasNext(FilterByTypeStep.java:97)
at com.arcadedb.query.sql.executor.SubQueryStep$1.hasNext(SubQueryStep.java:53)
at com.arcadedb.query.sql.executor.CheckSafeDeleteStep$1.hasNext(CheckSafeDeleteStep.java:47)
at com.arcadedb.query.sql.executor.DeleteStep$1.hasNext(DeleteStep.java:40)
at com.arcadedb.query.sql.executor.CountStep.syncPull(CountStep.java:52)
at com.arcadedb.query.sql.executor.SelectExecutionPlan.fetchNext(SelectExecutionPlan.java:44)
at com.arcadedb.query.sql.executor.UpdateExecutionPlan.executeInternal(UpdateExecutionPlan.java:64)
at com.arcadedb.query.sql.executor.ScriptLineStep.syncPull(ScriptLineStep.java:50)
at com.arcadedb.query.sql.executor.ScriptExecutionPlan.doExecute(ScriptExecutionPlan.java:101)
at com.arcadedb.query.sql.executor.ScriptExecutionPlan.fetchNext(ScriptExecutionPlan.java:62)
at com.arcadedb.query.sql.parser.LocalResultSet.fetchNext(LocalResultSet.java:44)
at com.arcadedb.query.sql.parser.LocalResultSet.(LocalResultSet.java:40)
at com.arcadedb.query.sql.SQLScriptQueryEngine.executeInternal(SQLScriptQueryEngine.java:220)
at com.arcadedb.query.sql.SQLScriptQueryEngine.command(SQLScriptQueryEngine.java:121)
at com.arcadedb.database.LocalDatabase.command(LocalDatabase.java:1324)
at ArcadeDBTest.lambda$0(ArcadeDBTest.java:37)
at com.arcadedb.database.LocalDatabase.transaction(LocalDatabase.java:1069)
at com.arcadedb.database.LocalDatabase.transaction(LocalDatabase.java:1034)
at ArcadeDBTest.main(ArcadeDBTest.java:36)

expected behaviour:
Delete is executed succesfully

Alternatively import the following data and try to execute the delete
generatedData.zip

Reacted by Ruslan Butyk, Dominik Bergen and cindy-kuhn-fnt

Activity

  1. lvca
    self-assigned this
    on Mar 25, 2025
  2. lvca
    added
    bug
    on Mar 25, 2025
  3. lvca
    added the
    Bug
    issue type on Mar 25, 2025
  4. lvca
    added this to the 25.4.1 milestone on Mar 25, 2025
  5. lvca commented on Mar 26, 2025

    @lvca
    lvca
    on Mar 26, 2025
    Member
    More actions

    Reproduced.

  6. lvca
    added a commit that references this issue on Mar 26, 2025

    fix: improved selection of index in query planner

    ed567fb
  7. lvca commented on Mar 26, 2025

    @lvca
    lvca
    on Mar 26, 2025
    Member
    More actions

    I've pulled the most recent changes in the SQL engine from OrientDB (where the SQL engine was forged from). Now this test passes, but I'm fixing other test cases that are in error.

    Reacted by achim-haeberle-fnt and Ruslan Butyk
  8. lvca
    added
    in progressThe team is actively working on this issue
    on Mar 26, 2025
  9. lvca
    added a commit that references this issue on Mar 27, 2025

    Issue 2092 (#2096)

    7de3613
  10. lvca commented on Mar 27, 2025

    @lvca
    lvca
    on Mar 27, 2025
    Member
    More actions

    This now works with the latest branch (25.4.1-SNAPSHOT)

    Reacted by Ruslan Butyk
  11. lvca
    closed this as completedon Mar 27, 2025
  12. lvca
    added
    fixed
    and removed
    in progressThe team is actively working on this issue
    on Mar 27, 2025
  13. ruslan-butyk-fntext commented on Jan 26, 2026

    @ruslan-butyk-fntext
    ruslan-butyk-fntext
    on Jan 26, 2026
    More actions

    This issue is reproducible again on the 26.1.1. I've imported the dump from attached zip and executed DELETE FROM zone_device WHERE from_id='zone1'; and got an error: ERROR: key is composed of 1 items, while the index defined 3 items.
    @lvca please check it.
    UPD: also reproducible on 25.10.1-SNAPSHOT - java17 branch
    UPD: not reproducible on 26.2.1-SNAPSHOT

  14. lvca commented on Jan 28, 2026

    @lvca
    lvca
    on Jan 28, 2026
    Member
    More actions

    @ruslan-butyk-fntext so is it working against the latest snapshot?

  15. lvca
    modified the milestones: 25.4.1, 26.2.1 on Jan 28, 2026
  16. ruslan-butyk-fntext commented on Jan 28, 2026

    @ruslan-butyk-fntext
    ruslan-butyk-fntext
    on Jan 28, 2026
    More actions

    @lvca yes it was working fine on the 26.2.1-SNAPSHOT.
    Worth to notice that command() method of Database that I've used to execute SQL on all mentioned ArcadeDB versions on 26.2.1-SNAPSHOT requires to start transaction explicitly but didn't require that in all other versions. Don't know if it's connected somehow to the issue.

  17. lvca commented on Jan 29, 2026

    @lvca
    lvca
    on Jan 29, 2026
    Member
    More actions

    It should be managed by explicit transaction setting. If set to true, it should be able to do begin/commit atomicaly

    Reacted by Ruslan Butyk
  18. mergify
    added 2 commits that reference this issue on May 13, 2026

    chore(deps-dev): bump protobufjs from 7.5.5 to 7.5.8 in /e2e-js [skip…

    20ae85d

    chore(deps-dev): bump protobufjs from 7.5.5 to 7.5.8 in /e2e-studio […

    826c16e
  19. lvca
    added a commit that references this issue on Jun 12, 2026

    fix: #4600 SQL planner prefers a full-key index over a partial-key sc…

    7e96a44
  20. tae898
    added 4 commits that reference this issue on Jun 28, 2026

    Issue 2092 (ArcadeData#2096)

    ab0209c

    chore(deps-dev): bump protobufjs from 7.5.5 to 7.5.8 in /e2e-js [skip…

    9d564a1

    chore(deps-dev): bump protobufjs from 7.5.5 to 7.5.8 in /e2e-studio […

    57cf30d

    fix: ArcadeData#4600 SQL planner prefers a full-key index over a part…

    5ef5a55
  21. robfrank
    added a commit that references this issue on Aug 14, 2026

    fix: #4600 SQL planner prefers a full-key index over a partial-key sc…

    34cca6b
  22. mergify
    added a commit that references this issue on Aug 30, 2026

    chore(deps): bump https://github.com/pycqa/isort from 8.0.1 to 9.0.0 …

    2d4e624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

No labels
No labels

Type

Bug

Projects

No projects

    Milestone

    • 26.2.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.