Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed default buckets per type to 1 #1903

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/src/main/java/com/arcadedb/GlobalConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public Object call(final Object value) {
50),

TYPE_DEFAULT_BUCKETS("arcadedb.typeDefaultBuckets", SCOPE.DATABASE, "Default number of buckets to create per type", Integer.class,
8),
1),

BUCKET_DEFAULT_PAGE_SIZE("arcadedb.bucketDefaultPageSize", SCOPE.DATABASE,
"Default page size in bytes for buckets. Default is 64KB", Integer.class, 65_536),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,7 @@ else if (o instanceof Result && ((Result) o).isElement())
}
info.fetchExecutionPlan.chain(new ParallelExecStep(plans, context));
} else if (target.getIndex() != null) {
if (info.buckets.size() > 1)
handleIndexAsTarget(info.fetchExecutionPlan, info, target.getIndex(), null, context);
handleIndexAsTarget(info.fetchExecutionPlan, info, target.getIndex(), null, context);
} else if (target.getSchema() != null) {
handleSchemaAsTarget(info.fetchExecutionPlan, target.getSchema(), context);
} else if (target.getRids() != null && !target.getRids().isEmpty()) {
Expand Down Expand Up @@ -1697,17 +1696,17 @@ private List<ExecutionStepInternal> handleTypeAsTargetWithIndex(

final List<IndexSearchDescriptor> indexSearchDescriptors =
info.flattenedWhereClause.stream()
.map(x -> findBestIndexFor(context, indexes, x, typez))
.map(x -> findBestIndexFor(context, indexes, x, typez))
.filter(Objects::nonNull)
.collect(Collectors.toList());

if (indexSearchDescriptors.isEmpty())
return null;

// TODO
if (indexSearchDescriptors.size() != info.flattenedWhereClause.size()) {
return null; //some blocks could not be managed with an index
}
if (indexSearchDescriptors.size() != info.flattenedWhereClause.size()) {
return null; //some blocks could not be managed with an index
}

// // ARCADEDB: NOT APPLICABLE TO ORIENTDB
// // IF THERE ARE ANY CHANGES IN TX, AVOID IT
Expand Down
2 changes: 1 addition & 1 deletion engine/src/test/java/com/arcadedb/ACIDTransactionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void testAsyncIOExceptionAfterWALIsWrittenManyRecords() {
@Test
public void multiThreadConcurrentTransactions() {
database.transaction(() -> {
final DocumentType type = database.getSchema().createDocumentType("Stock");
final DocumentType type = database.getSchema().createDocumentType("Stock", 8);
type.createProperty("symbol", Type.STRING);
type.createProperty("date", Type.DATETIME);
type.createProperty("history", Type.LIST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected void beginTest() {
database.transaction(() -> {
if (database.getSchema().existsType("Node"))
database.getSchema().dropType("Node");
database.getSchema().createVertexType("Node");
database.getSchema().createVertexType("Node", 8);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void testCommitRetry() {
@Test
public void testCommitRetryMultiThreadsSQLIncrement() throws IOException {
String className = "testCommitRetryMTSQLIncrement";
database.getSchema().createDocumentType(className);
database.getSchema().createDocumentType(className, 8);

// AVOID RETRY, EXPECTING TO MISS SOME UPDATES
database.transaction(() -> {
Expand Down Expand Up @@ -258,7 +258,7 @@ public void testCommitRetryMultiThreadsSQLIncrement() throws IOException {
@Test
public void testCommitRetryMultiThreadsSQLIncrementRepeatableRead() throws IOException {
String className = "testCommitRetryMTSQLIncrement";
database.getSchema().createDocumentType(className);
database.getSchema().createDocumentType(className, 8);

// AVOID RETRY, EXPECTING TO MISS SOME UPDATES
database.transaction(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ public void testFetchFromSingleRidParam() {

@Test
public void testFetchFromSingleRid3() {
database.getSchema().createDocumentType("testFetchFromSingleRid3");
database.getSchema().createDocumentType("testFetchFromSingleRid3", 8);
database.begin();
MutableDocument doc = database.newDocument("testFetchFromSingleRid3");
doc.save();
Expand All @@ -1089,7 +1089,7 @@ public void testFetchFromSingleRid3() {

@Test
public void testFetchFromSingleRid4() {
database.getSchema().createDocumentType("testFetchFromSingleRid4");
database.getSchema().createDocumentType("testFetchFromSingleRid4", 8);
database.begin();
MutableDocument doc = database.newDocument("testFetchFromSingleRid4");
doc.save();
Expand Down
Loading