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

Tweak MixedWorkload to add limit to SELECT #2244

Merged
merged 1 commit into from
Mar 25, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
@State(Scope.Benchmark)
public class MixedWorkload extends BenchmarkBase {
private static final Logger LOGGER = LoggerFactory.getLogger(MixedWorkload.class);
private static final int LIMIT = 10000;

private ClickHouseClient clientV1Shared;
private Client clientV2Shared;
Expand All @@ -56,12 +57,6 @@ public void tearDownTrial() {
}
}

// @State(Scope.Thread)
// public static class MixedWorkloadState {
// @Param({"true", "false"})
// public boolean alternate;
// }


@TearDown(Level.Iteration)
public void teardownIteration(DataState dataState) {
Expand Down Expand Up @@ -124,7 +119,7 @@ public void insertV1RowBinary(DataState dataState) {
public void queryV1(DataState dataState, Blackhole blackhole) {
try {
try (ClickHouseResponse response = clientV1Shared.read(getServer())
.query(BenchmarkRunner.getSelectQuery(dataState.tableNameFilled))
.query(BenchmarkRunner.getSelectQueryWithLimit(dataState.tableNameFilled, LIMIT))
.format(ClickHouseFormat.RowBinaryWithNamesAndTypes)
.option(ClickHouseClientOption.ASYNC, false)
.executeAndWait()) {
Expand Down Expand Up @@ -190,7 +185,7 @@ public void insertV2RowBinary(DataState dataState) {
@Group("mixed_v2")
public void queryV2(DataState dataState, Blackhole blackhole) {
try {
try(QueryResponse response = clientV2Shared.query(BenchmarkRunner.getSelectQuery(dataState.tableNameFilled)).get()) {
try(QueryResponse response = clientV2Shared.query(BenchmarkRunner.getSelectQueryWithLimit(dataState.tableNameFilled, LIMIT)).get()) {
ClickHouseBinaryFormatReader reader = clientV2Shared.newBinaryFormatReader(response);
while (reader.next() != null) {//Compiler optimization avoidance
for (int i = 1; i <= dataState.dataSet.getSchema().getColumns().size(); i++) {
Expand Down
Loading