Skip to content

SQL: "ORDER BY" skips NULL value for indexed properties #2692

@gramian

Description

@gramian

ArcadeDB Server v25.10.1-SNAPSHOT (build 303868455cdd9ab4a7e30a1d71ae3e4985e03747/1761120719567/main)

Running on Linux 6.14.0-33-generic - OpenJDK 64-Bit Server VM 21.0.8

Given a type with an indexed property, the number of results varies if ordered or not.

CREATE DOCUMENT TYPE doc;
CREATE PROPERTY doc.num LONG;
CREATE INDEX ON doc (num) NOTUNIQUE;
INSERT INTO doc SET num = 1;
INSERT INTO doc SET num = 2;
INSERT INTO doc;
SELECT FROM doc -- returns 3 records
SELECT FROM doc ORDER BY num -- returns 2 records

Is this behavior expected? If so, I would document it.

Given the default NULL_STRATEGY of SKIP, it seems ORDER BY uses the index, but does not prepend or append all records with a NULL property.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions