Extra Credit Project for CS 411

Overview

#Extra Credit Project for CS 411

CS411ExtraCredit

Commands to run JOINS with Nation and Region Files

*NOTE region.tbl files and nation.tbl files are already provided in the data folder of this repo

  1. Clone the Repo
  2. Navigate to the directory where main.cpp is located and run the following commands

Compilation Command:

g++ -std=c++11  main.cpp join.cpp

RUN these commands for SAMPLE CSV FILES (nation.tbl and region.tbl)

Run NESTED LOOP JOIN (write to file looptest.tbl):

./a.out ./data/region.tbl REGIONKEY  ./data/nation.tbl NESTED_LOOP  looptest.tbl

Run HASH JOIN (write to file hashtest.tbl):

./a.out ./data/region.tbl REGIONKEY  ./data/nation.tbl HASH  hashtest.tbl

BENCHMARKING

BENCHMARKS for the joins of LINEITEMS and ORDERS on ORDERKEY

NESTED LOOP JOIN STATISTICS:
    Iteration 0 took: 130488240 microseconds
    Iteration 1 took: 139611762 microseconds
    Iteration 2 took: 236482821 microseconds
    Iteration 3 took: 143621481 microseconds
    Iteration 4 took: 121202169 microseconds
    Iteration 5 took: 125653486 microseconds
    Iteration 6 took: 132158750 microseconds
    Iteration 7 took: 125003932 microseconds
    Iteration 8 took: 177286295 microseconds
    Iteration 9 took: 127883006 microseconds
    AVG TIME per join is 145939194 microseconds

HASH JOIN STATISTICS Program Output:
    Iteration 0 took: 508560 microseconds
    Iteration 1 took: 483130 microseconds
    Iteration 2 took: 455785 microseconds
    Iteration 3 took: 461192 microseconds
    Iteration 4 took: 453712 microseconds
    Iteration 5 took: 454724 microseconds
    Iteration 6 took: 460034 microseconds
    Iteration 7 took: 456801 microseconds
    Iteration 8 took: 471699 microseconds
    Iteration 9 took: 474220 microseconds
    AVG TIME per join is 467985 microseconds

TAKEAWAYS: The NESTED LOOP JOIN takes significantly more time on average than the HASH Join. This is primarily because the HASH Join takes advantage of the O(1) lookup time of a hashmap while the NESTED_LOOP has 2 loops making it an O(n^2) algorithm generally.

According to the textbook:

BLOCK-BASED NESTED LOOP JOIN COST: B(R) + B(R)*B(S)

HASH JOIN COST: B(R) + B(S)

DISCLAIMER: Since DATASET was too large, used Dr.Park's recoomendation and used a hash to cut the overall amount of data. Used a hash on ORDERKEY with a threshold of hash(ORDERKEY) < 0.01

Note that in the code implementation, the commented Code contains the hash filtering mechanism. It is commented out since it is not needed for running the smaller tests on Nation and Region Files.

You might also like...
Operating system project - implementing scheduling algorithms and some system calls for XV6 OS

About XV6 xv6 is a modern reimplementation of Sixth Edition Unix in ANSI C for multiprocessor x86 and RISC-V systems.

ESP32 based DIY word clock project
ESP32 based DIY word clock project

Wordclock ESP32 based DIY wordclock project TL;DR: check out this ✨ demo video ✨ Another take on the classic DIY word clock. This one requires a laser

Project to check which Nt/Zw functions your local EDR is hooking

Probatorum EDR Userland Hook Checker Probatorum will check which Nt/Zw functions your local EDR is hooking. Most credit for this code goes to SolomonS

Port of my M5Stack Core 2 audio monitor project to generic ESP32s with TFT screens
Port of my M5Stack Core 2 audio monitor project to generic ESP32s with TFT screens

ESP32 Audio Monitor This is a port of this project to work with any ESP32 device with a TFT display. You can watch a video explainer here (YouTube) wh

This is 3d printer motherboard for VORON project.
This is 3d printer motherboard for VORON project.

Features Compact size: 155.3mm x 76.5mm Based on STM32F446 180Mhz,all IOs can withstand 5V voltage 8 TMC stepper drivers support, with Uart&SPI suppor

This project shows how to interface Nokia 5110 LCD with Esp32 module to show current prices of any cryptocurrency like Bitcoin, Dogecoin, etc
This project shows how to interface Nokia 5110 LCD with Esp32 module to show current prices of any cryptocurrency like Bitcoin, Dogecoin, etc

ESP32 Cryptocurreny Ticker Introduction This project shows how to interface Nokia 5110 LCD with Esp32 module to show current prices of any cryptocurre

This is an experimental OS-from-scratch project. Just for demonstration, not useful at all.
This is an experimental OS-from-scratch project. Just for demonstration, not useful at all.

OS Playground This is an experimental OS-from-scratch project. Just for demonstration, not useful at all. Different from OS in other projects, this OS

Repo for the DSA Mini-project Directory Manager

Directory Manager Repo for the DSA Mini-project Directory Manager Installation and Setup To setup the program on your desktop, do the following. git c

Simple template project to build a firmware for the STM32F4 Discovery board with FreeRTOS and libopencm3

STM32F4 Discovery FreeRTOS Makfile This is a simple template project to build a firmware for the STM32F4 Discovery board with FreeRTOS and libopencm3

Owner
null
Add extra features to Discord via patches!

DiscordExtras An iOS tweak that lets you apply patches the iOS Discord client. Available on my repo here. Components DiscordExtrasPrefs This includes

Zoey 32 Sep 28, 2022
Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.

Dear ImGui (This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addit

Flix 352 Dec 28, 2022
dogefetch, a project made in C for doges, very project, much wow

dogefetch dogefetch, a project made in C for doges, very project, much wow. before installing this project uses nerd fonts, please install it to see t

null 18 Oct 17, 2022
this project is a function in c to take the next line of a file or a file descriptor. this is a project of 42 school.

Get Next Line of 42. Make with ❤︎ for Luiz Cezario ?? Index What's this Repo? List of Archives Technologies How to Run Find a Bug? Or somenthing need

Luiz lima cezario 7 Nov 28, 2022
The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project.

ATM - Automated Teller Machine The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project. What is ATM? An automated t

Sorav Kumar Sharma 1 Nov 7, 2021
The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project.

ATM - Automated Teller Machine The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project. What is ATM? An automated t

Sorav Kumar Sharma 1 Nov 8, 2021
The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project.

ATM - Automated Teller Machine The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project. What is ATM? An automated t

Sorav Kumar Sharma 0 Dec 26, 2021
This is a project for Rowans ECE Final Project

ECEExposureProject This is a project for Rowans ECE Final Project There are 3 files that can be found in this repository. DHT PIP-Brick - This program

Craig Droke 1 Dec 8, 2021
This project generates a keycodes.h file for my fractol project

keycodes_generator This project generates a keycodes.h file for my fractol project It uses the last version of minilibx The program opens a minilibx w

pohl 3 Mar 23, 2022
Small commandlet for generating a complete project using UE4SS header dump, Project File and Plugin Manifest

UE4GameProjectGenerator Small commandlet for generating a complete project using UE4SS header dump, Project File and Plugin Manifest Usage Compile the

null 8 Nov 27, 2022