twright-msft / columnstore-demo

Simple demo application showing the performance benefits of columnstore in SQL Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

columnstore-demo

This is a simple Java-based command line application that shows how to use a clustered columnstore index to improve performance.

The application does the following:

  • The application uses the Microsoft JDBC connector to connect to SQL Server.
  • Then it runs a simple query to get and display the version information.
  • Next it runs queries to create an 'Example' database and a Orders table.
  • A query is then run to generate some demo data in the Orders table.
  • The application then runs a query to sum up the Price column in the Orders table.
  • The elapsed time to run the query is shown.
  • Then a clustered columnstore index is created.
  • Lastly, the same query is run to sum the Price column in the Orders table.
  • The elapsed time is shown for the query after the clustered columnstore index is added.
  • The performance improvement from adding the columnstore index is shown.

To run this application you need to have the following installed:

Before you run this application, change the connectionUrl information: server name, port, default database, user, password

After making changes to the .java file, recompile with this command:

javac ColumnstoreDemo.java

To run this application from the directory where the project is cloned:

java -cp .:/<location of JDBC driver jar> ColumnstoreDemo

Example:

java -cp .:/Users/travis/Projects/sqljdbc42.jar ColumnstoreDemo

About

Simple demo application showing the performance benefits of columnstore in SQL Server


Languages

Language:Java 100.0%