Giter Site home page Giter Site logo

db-performance-check's Introduction

MySQL vs PostgreSQL


구분 버전
OS 환경 Window 10 Pro
RAM 32GB
Mysql 8
PostgreSQL 15
Spring 3.1.2
JDK 17

읽기와 쓰기 단계로 나뉘어서 테스트 코드 작성 및 속도 체크 하였습니다.

읽기는 약 2,073,677건의 데이터를 가지고 사용 하였습니다.

또한, 기존의 데이터는 null 값이 많은 컬럼들의 데이터들을 삭제하였습니다.

데이터를 1차 가공하여 사용하였습니다.


성능 체크 : Hibernate Statistics

Hibernate는 JPA의 한 구현체로, hibernate.generate_statistics 속성을 true로 설정하면 SQL 쿼리에 대한 통계를 수집합니다. 이 통계에는 쿼리 수행 시간이 포함됩니다. 이 방법은 디버깅과 프로토타이핑 단계에서 유용하지만, 프로덕션 환경에서는 부가적인 오버헤드 때문에 사용하지 않는 것이 좋습니다.

성능 테스트 목록

  • 전체 조회
  • 단건 조회
  • like 조회
  • index 조회
  • 1만, 10만, 100만 데이터 입력

읽기 총 결과

PostgreSQL MySQL
전체 조회 11,688ms (약 11초) 15,366ms (약 15초)
단건 조회 219ms (약 0.219초) 2,544ms (약 2초)
like 조회 236ms (약 0.236초) 2,816ms (약 2초)
index 조회 133ms (약 0.133초) 134ms (약 134초)

KakaoTalk_20230807_234539283_01

쓰기 총 결과

PostgreSQL MySQL
1만건 1,617ms (약 1초) 2,085ms (약 2초)
10만건 17,861ms (약 17초) 24,683ms (약 24초)
100만건 162,229ms (약 2분 42초) 208,652ms (약 3분 29초)

KakaoTalk_20230807_234539283


db-performance-check's People

Contributors

domae-back-end avatar

Stargazers

 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.