Search in sources :

Example 51 with QueryableIndexSegment

use of org.apache.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexStringThenLong.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexStringThenLong(Blackhole blackhole) {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
    runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, longQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(org.apache.druid.segment.QueryableIndexSegment) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) Result(org.apache.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 52 with QueryableIndexSegment

use of org.apache.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexStringThenFloat.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexStringThenFloat(Blackhole blackhole) {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
    runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, floatQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(org.apache.druid.segment.QueryableIndexSegment) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) Result(org.apache.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 53 with QueryableIndexSegment

use of org.apache.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexFloatOnly.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexFloatOnly(Blackhole blackhole) {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, floatQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(org.apache.druid.segment.QueryableIndexSegment) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) Result(org.apache.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 54 with QueryableIndexSegment

use of org.apache.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexLongOnly.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexLongOnly(Blackhole blackhole) {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, longQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(org.apache.druid.segment.QueryableIndexSegment) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) Result(org.apache.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 55 with QueryableIndexSegment

use of org.apache.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexLongThenString.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexLongThenString(Blackhole blackhole) {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, longQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
    runner = QueryBenchmarkUtil.makeQueryRunner(factory, Q_INDEX_SEGMENT_ID, new QueryableIndexSegment(qIndexes.get(0), Q_INDEX_SEGMENT_ID));
    results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(org.apache.druid.segment.QueryableIndexSegment) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) Result(org.apache.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Aggregations

QueryableIndexSegment (org.apache.druid.segment.QueryableIndexSegment)96 Benchmark (org.openjdk.jmh.annotations.Benchmark)37 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)37 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)37 ResultRow (org.apache.druid.query.groupby.ResultRow)34 IncrementalIndexSegment (org.apache.druid.segment.IncrementalIndexSegment)28 Test (org.junit.Test)28 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)26 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)24 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)24 Result (org.apache.druid.query.Result)23 GroupByQueryRunnerTest (org.apache.druid.query.groupby.GroupByQueryRunnerTest)23 ArrayList (java.util.ArrayList)22 LegacySegmentSpec (org.apache.druid.query.spec.LegacySegmentSpec)21 GroupByQuery (org.apache.druid.query.groupby.GroupByQuery)20 ExpressionVirtualColumn (org.apache.druid.segment.virtual.ExpressionVirtualColumn)18 TopNResultValue (org.apache.druid.query.topn.TopNResultValue)17 QueryableIndex (org.apache.druid.segment.QueryableIndex)17 QueryRunner (org.apache.druid.query.QueryRunner)15 FinalizeResultsQueryRunner (org.apache.druid.query.FinalizeResultsQueryRunner)13