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

Introduce templated benchmarks. #301

Merged
merged 95 commits into from
Oct 2, 2023

Conversation

anjagruenheid
Copy link
Contributor

@anjagruenheid anjagruenheid commented Apr 20, 2023

This PR introduces templated benchmarks for BenchBase. In essence, users can define their own query templates that are parametrized with one or more values at runtime. If multiple parameter combinations are possible, we will continue to cycle through all available combinations.

A templated benchmark has the structure

<templates> 
    <template name="$QueryTemplateName">   
        <query>$SQLQuery</query>   
        <types>
            <type>$ParameterType1</type>
            <type>$ParameterType2</type>
        </types>   
        <values>     
            <value>$ParameterValueA1</value>
            <value>$ParameterValueA2</value>
            ...
        </values>
        <values>     
            <value>$ParameterValueB1</value>
            <value>$ParameterValueB2</value>
            ...
        </values> 
    </template> ...
<templates>

where $ParameterType is the integer java.sql.Types value (i.e., 4 for integer, 16 for boolean etc.) and each value tag within 'parameter_values' contains the values for one instantiation of the parameters set in $SQLQuery. The SQL query string is read as a PreparedStatement, i.e., parameters are defined in the string via a '?' placeholder. An example for a templated benchmark can be found in data/templated/example.xml. The file path for the XML template has to be defined in the workload configuration using the 'query_templates_file' tag. An example configuration can be found in config/sqlserver/sample_template_config.xml. The example can be executed if a loaded TPC-C instance is used as JDBC endpoint.

Templated benchmarks are instantiated using 'templated' as benchmark class when running BenchBase via the command line.

@anjagruenheid anjagruenheid changed the title Draft for templated benchmarks. Introduce templated benchmarks. Apr 20, 2023
data/templated/example.xml Outdated Show resolved Hide resolved
data/templated/example.xml Outdated Show resolved Hide resolved
Copy link
Collaborator

@bpkroth bpkroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ready to go.
It's got lots of tests, both unit and functional for several major DBs now.
The only remaining issue was support for NULLable fields and we filed #366 to track that in future work.

@bpkroth bpkroth merged commit 611f3d4 into cmu-db:main Oct 2, 2023
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants