Git Product home page Git Product logo

baohnguyen95 / seeqr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-source-labs/seeqr

1.0 0.0 0.0 29.06 MB

A database analytic tool that allows a developer to compare the efficiency of different schemas and queries on a granular level to make better informed architectural decisions regarding SQL databases at various scales.

Home Page: https://www.seeqr.info

License: MIT License

JavaScript 2.49% TypeScript 97.51%

seeqr's Introduction

PRs Welcome Release: 4.0 License: MIT Contributions Welcome Twitter Github stars Tests

SeeQR.info

SeeQR: A database analytic tool to compare the efficiency of different schemas and queries on a granular level so that developers/architects can make better informed architectural decisions regarding SQL databases at various scales.

Table of Contents

Getting Started

To get started on contributing to this project:

  1. Download and install Postgres.app and start it before opening up SeeQR
  2. Ensure that psql is available in the $PATH
  3. Ensure that a 'postgres' role exists
  4. Download the latest version of SeeQR

Built With

Interface & Features

  • Overview

    • Upon application launch, select the desired database to connect to or follow the quick-start guide to get started
    • The application connects to the local instance of PostgreSQL using the role 'postgres', so all databases that 'postgres' has access to are available
    • Besides using the existing databases, the application also provides various options to create new databases:
      • Importing .sql or .tar files
      • Navigating to the Create Database view at bottom of sidebar
      • Copying an existing database (with or without original data)
    • Users can export any database onto their local machine
    • Users can toggle between the 'DATABASES' view and the 'QUERIES' view
  • Databases

    • In the 'DATABASES' view, users can select a table from a list of all the tables in the schema of the currently selected database
    • Information about the selected table is then displayed
    • The name and size of the selected database are also displayed at the top of the page
    • Users can also generate large amounts of foreign-key compliant dummy data for the selected table in the current database. Currently supported data types are:
      • INT
      • SMALLINT
      • BIGINT
      • VARCHAR
      • BOOLEAN
      • DATE

  • Create/Edit Database (currently in beta)

    • Users can create a new database from scratch by clicking the Create New Database button at the bottom of the sidebar
    • Once a the database is given a name, htiting the Initialize Database button will create new database on the users PostgreSQL instance
    • Users can then input SQL commands and click Update Database to create and drop tables in the database
    • Users have the option to alter any existing databases as well by selecting the database on the sidebar and running any SQL commands they would like.
    • The Export button will write a .sql file on the user's desktop of the selected database

- Queries
  • In the 'QUERIES' view, the main panel is where the query input text field is located, utilizing CodeMirror. The paint button in the top right corner of the panel auto-formats the inputted query
  • Users can select the database to use in the 'Database' dropdown above the main panel
  • Users also have the option to execute a labelled or unlabelled query — simply provide a label in the 'Label' field above the main panel to identify the query in later comparisons against other queries
    • Please note that only labelled queries will be saved in the current session for future references
  • To execute the query, simply select the 'RUN QUERY' button at the bottom of the panel or press 'Ctrl-Enter' on the keyboard

  • Data

    • Once executed, the query's output will be displayed. In addition, for eligible queries, users will be able to view the queries' planning time, execution time, total run time, and plan of execution
      • Eligible queries include any SELECT, INSERT, UPDATE, DELETE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS statement
    • Users can toggle between the executed query's 'RESULTS' and 'EXECUTION PLAN'
    • The 'RESULTS' view displays the executed query's returned results
    • The 'EXECUTION PLAN' view displays the executed query's plan of execution
      • Within the 'EXECUTION PLAN', users can adjust the thresholds of 'Percentage of Total Duration' and the 'Planner Rows Accuracy' that are used to highlight certain nodes in the tree
        • The 'Percentage of Total Duration' threshold is used to highlight the nodes whose durations are higher than the set limit, indicating that these nodes may be areas of improvement
        • The 'Planner Rows Accuracy' threshold is used to highlight the nodes for which the planner's estimate number of rows differs from the actual number of rows, indicating that the database might need vacuuming
      • Clicking on a node will display additional details regarding that action as well
    • To execute a new query, simply select the '+' button in the sidebar. To go back to a previously saved query, just select it in the sidebar

  • Compare

    • Click on the 'bar graph' icon at the top of the sidebar to get to the 'Compare Queries' view
    • The comparison table is flexible to the user’s preferences as the user selects which queries to compare side by side
    • Simply check or uncheck the box next to each saved query to add or remove the query from the graph
    • Graph will be organized along the x-axis by label, and colored by schema
    • Aside from the visualized performance comparison of the selected queries, a table will display information about each selected query, including its total run time and performance relative to other queries with the same label, with the most performant query highlighted

Application Architecture and Logic

Cross-Database Comparisons
One of the key features of SeeQR is to compare the efficiency of executing user-inputted queries against different databases. This allows customization of table scale, relationship, type, and the queries themselves within the context of each database. This flexibility affords the user granular adjustments for testing every desired scenario. Please refer to “Interface & Features” for more details on execution.

Session-based Result Caching
The outcome results from each query, both retrieved data and analytics, are stored in the application’s state, which can be viewed and compared in table and visualizer formats. Note that these results’ persistence is session-based and will be cleared upon quitting the application.

Contributing

We've released SeeQR because it's a useful tool to help optimize SQL databases. Additional features, extensions, and improvements will continue to be introduced. We are thankful for any contributions from the community and we encourage you to try SeeQR out to make or suggest improvements where you see fit! If you encounter any issues with the application, please report them in the issues tab or submit a PR. Thank you for your interest!

Core Team

Allison Le | Brandon Lee | Casey Escovedo | Casey Walker | Catherine Chiu | Chris Akinrinade | Cindy Chau | Claudio Santos | Faraz Akhtar | Frank Norton | Harrison Nam | James Kolotouros | Jennifer Courtner | Justin Dury-Agri | Katie Klochan | Mercer Stronck | Muhammad Trad | Richard Guo | Richard Lam | Sam Frakes | Serena Kuo | Timothy Sin

License

SeeQR is MIT licensed.

seeqr's People

Contributors

claudiohbsantos avatar catherinechiu avatar cindychau avatar rlam108 avatar serenackuo avatar cwalker3011 avatar justind-a avatar muhammadtrad avatar jcourtner avatar franknorton32 avatar faraza22 avatar caseyescovedo avatar frakes413 avatar mstronck avatar harrynam07 avatar chrisakinrinade avatar kklochan avatar allisonle1 avatar

Stargazers

Roman avatar

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.