Coder Social home page Coder Social logo

db-tuning-optimization-and-analysis's Introduction

DB-Tuning-Optimization-and-Analysis

In this project, We aim to test some queries on different sizes of same schema and optimized schema then analayze the performanc in MySQL and MongoDB Our datbase is called OnlineStore.

Database record sizes:

  • 10 thousand
  • 100 thousand
  • 1 million

We used DBForge for data seeding.

The 3 sizes is applied for both the normal schema and optimized schema, thus we have 6 schemas in MySQL datbase.

Also the 100-thousand database record size is applied on MongoDB on the optimized schema.

We applied the project on 2 phases:

  1. Proposal phase [phase 1]
  2. Implementation phase [phase 2]

Phase 1

This is the schema: schema

This is the ER Diagram: ER diagram

Phase 2

In this phase, we applied optimization on database. 4 types of optimization were applied:

  1. Optimizing the schema.

  2. Optimizing the memory requirements.

  3. Optimizing the queries.

  4. Adding Indeces.

  5. Optimizing the schema This is the schema after optimization

We merged 2 tables(order and orderComponent -> OrderOptimized), to make less joines.

schema_after_optimization

  1. Optimizing the memory requirements We changed the block size to increase its buffer, to speed up the join.

  2. Optimizing the queries Instead of using cross product, we used join.

  3. Adding Indeces By default, MySQL put index for primary keys, so add index in the table that have lots of foreign keys. We put compound index on the 3 foriegn keys in orderOptimized to speed up the lookup for join.

Here is the Database Analysis after each optimization: Database_Analysis

In each sql file, we put the schema and indeces in addition to the queries applied with their running time, cost and tree excution plan.

For furthur documentation and details, check our Report

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.