Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

jmdha/P6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JANTIMATOR: Join Analysis of iNequality esTIMATOR

This is a project about creating better cardinality estimates for Join Queries with inequality predicates. Todays systems are not geared towards giving good cardinality estimates for these queries, which is something this project aims to do something about.

ezgif-2-c037fe5652

The program itself consists of a WPF interface written in C#. The program is capable of taking a set of queries in a json format, see what a given database system would estimate the cardinality of said query and then give a new estimate from our estimator. This program itself uses MySQL and PostgeSQL to run queries on.

Datasets

For this project, 10 syntetic datasets and 3 real datasets was used. The syntetic datasets have the same table setup (See mysql table definitions and postgres table definitions for details) and the data is:

  • RandomNumberBlocks
    • Consisting of 4 tables with random values in them (See inserts for details)
  • ConstantNumberBlocks
  • ClumpedNumberBlocks_Difficult
  • ClumpedNumberBlocks_Possible
  • LinearNumberBlocks

In addition to this, there are Large verisons of them, with 5 times more rows in each table.

The real datasets are:

Setup

You need to setup the two database systems (or alternatively disable one them in the experiments.json file). The current tests are setup to use default users for PostgreSQL and MySQL.

MySQL: Username: root password password

PostgrSQL: Username: postgre password password

These can be changed in the secrets file (See the readme for more info).

Views

The program consist of 3 main views, the main view, the Sentinel Viewer and the Cache Viewer. The main view is the one shown when the program starts. This has options to turn on/off sentinels and a run button. If you press said button the program will start running through all the experiments defined in the experiments.json file (See the readme for more info)

Sentinel Viewer

Result sentinels are there to make sure that the database systems get the same result between runs. This is an additional safety check, to make sure the results are actually correct. See ResultsSentinel for more info.

Cache Viewer

This program makes use of caches to reduce execution times for tests. The Actual Cardinalities are saved to a cache file during runtime (and is loaded automatically on next launch). What is saved in these caches can be seen in the Cache Viewer, consisting of a MD5 hash of the data as well as the data itself.

Subviews

There are also two subviews, that can be used to debug or get a better understanding of what happens during the bounding and estimation process. One subview is for seeing how Milestones got generated, while the other is for each of the query file runs you can see how the bounding and estimation was set. These views are buttons under each testrunner that is displayed when the tests starts running.

Flow

A general flowchart of how the tests are run can be seen below. This is for each connector. flow