/db-performance-tests

Database performance tests

Primary LanguageTSQLMIT LicenseMIT

db-performance-tests

Database performance tests. The examples are inspired by the book SQL Performance explained.

DDL scripts by Markus Winand licensed under CC-BY-NC-ND 3.0 license

Prerequisites

Setup

TODO: Common traits

Postgres

  1. Start Postgres DB
cd postgres
docker-compose up

NOTE: This will create the database perftest and all tables initially.

  1. Connect with your favorite DB client``
"server": "localhost",
"port": 5432,
"username": "perftest",
"password": "example",
"database": "perftest"
  1. Run sample queries, e.g. postgres/sql/primary-keys.sql

The sample queries are creating execution plans, i.e. they use EXPLAIN.

SQL Server

  1. Start SQL Server
cd mssql
docker-compose up

NOTE: This will create the database perftest and all tables initially.

  1. Connect with your favorite DB client
"server": "localhost",
"port": 1433,
"username": "sa",
"password": "SuperStrong@Passw0rd",
"database": "perftest"
  1. Run sample queries, e.g. mssql/sql/primary-keys.sql

The sample queries are creating execution plans, i.e. they use set SET STATISTICS PROFILE ON and SET STATISTICS PROFILE OFF afterwards. This generates two results: The actual result and another one for the execution plan.

Project Board

Planned stuff goes into the Kanban Board.