GeezerVison is showing github.com — Indices are always unique (unique parameter is ignored on creation) · Issue #553 · ArcadeData/arcadedb
Indices are always unique (unique parameter is ignored on creation) #553DescriptionArcadeDB Version: <version here, you can find it on the first line of server output>
JDK Version: Oracle "18.0.2" 2022-07-19
OS: MacOS 12.6
Expected behavior
An Index would be unique only when the boolean parameter "unique" in the function call is set to true (when creating an index.
Actual behavior
Indices on vertices and edges are always unique
Steps to reproduce
com.arcadedb.schema.VertexType vertexTypeRoot = db.getSchema().getOrCreateVertexType( "VertexType" );
vertexTypeRoot
.getOrCreateProperty( "_tranid_", String.class )
.getOrCreateIndex( com.arcadedb.schema.Schema.INDEX_TYPE.LSM_TREE, false );
Activitylvca commented on Oct 7, 2022 How do you see they are always unique? Could you please provide the output from the API? You could also use the console with select from schema:indexes.
We have this test and I checked the index was not unique and it was:
@Test
public void testQueryMetadataIndexManager() {
DocumentType type = database.getSchema().createDocumentType("testQuerySchema");
database.begin();
type.createProperty("name", Type.STRING).createIndex(Schema.INDEX_TYPE.LSM_TREE, false);
database.commit();
ResultSet result = database.query("sql", "select from schema:indexes");
printExecutionPlan(result);
while (result.hasNext()) {
Assertions.assertTrue(result.hasNext());
Result item = result.next();
Assertions.assertNotNull(item.getProperty("name"));
Assertions.assertEquals("STRING", ((List<String>) item.getProperty("keyTypes")).get(0));
Assertions.assertFalse((Boolean) item.getProperty("unique"));
}
Assertions.assertFalse(result.hasNext());
result.close();
}nicolaiwadstrom commented on Oct 7, 2022 Forgot to add version, this was tested with ArcadeDB 22.9.1
Here is a screenshoot from the Console:

nicolaiwadstrom commented on Oct 7, 2022 Very odd, using select from schema:indexes from the console it shows unique to be false across all of the created indices..
What is interesting is that I do get an exception (Duplicate key on index) when inserting new vertices when the property is not unique for the tranId property
Maybe the index problems have to do with using super type relationships (there is a parent type vertex that have defined properties and indices), and the operations are done on the sub types? lvca commented on Oct 13, 2022 @nicolaiwadstrom how can I reproduce it? Could you please provide a set of SQL commands or a java code so we can create a test case based on it? Thanks in advance. lvca commented on Jan 16, 2023 No response from the author for a while, closing the issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|