전체 글
-
[DB] DB 조인 방식 3가지개발 2022. 1. 23. 16:42
물리적 Join 의 종류 Driving Table 과 Driven Table Join 시 먼저 액세스 되는 테이블과 아닌 테이블 Driving Table: 먼저 액세스 됨 Driven Table: 나중에 액세스 됨 Driving Table 은 DB 옵티마이저가 결정한다. DB Join의 방식 (물리적) Nested Loop Join https://coding-factory.tistory.com/756 2개 이상의 테이블에서 Driving Table 을 기준으로 Driven Table 을 스캔하여 결과를 서칭하는 것. 인덱스에 의한 랜덤 액세스에 기반하고 있으므로, Driving Table 서치 결과가 많을 수록 성능이 나빠짐. Driven Table 에는 조인을 위한 인덱스가 있어야만 한다. 이 때 Dr..
-
나는 생계형 개발자가 되고싶은가, 아니면 성장형 개발자가 되고싶은가?잡담 2022. 1. 7. 10:53
나는 생계형 개발자를 하고 싶은 건가 아니면 성장형 개발자(개쩌는 개발자!)를 하고 싶은 건가?생각보다는 모두가 일을 ‘잘’ 하고 싶어 하지는 않는 다는 것을 알게 되었다.일은 일일 뿐, 직장은 직장일 뿐이고 그 외에서 삶의 즐거움을 찾는 사람이 많다는 것이다. 내가 대학교 4학년때 교수님의 온라인 첫 수업에서 자기 소개 에세이를 제출했는데, 그 에세이에서 그런 말을 했었다.저는 이제 더 이상 내가 반드시 ‘열정’ 을 가지고 할 수 있는 일을 찾지 않기로 했다. 난 생각보다 일상의 행복에 만족하는 사람이었고, 일 외에 다른 곳에서 내가 행복할 방법을 찾겠다. 나는 생계형 개발자로 시작했다. 애초에 내가 개발자가 되기로 선택한 이유가 외국에 살고 싶었기 때문이고, 그 중 오피스 잡을 구할 수 있는 방법중 ..
-
[JPA] bulk data batch 작업 시 유의점개발 2022. 1. 6. 15:58
JPA 벌크 데이터 작업 시 유의점 JPA 의 벌크성 작업은 영속성 컨텍스트와 무관하다. 기존 엔티티 수정 메커니즘 JPA 는 엔티티를 영속성 컨텍스트에 보관한 후, DB에 반영한다. 이 때 최초상태를 복사해서 저장해두고, 플러시 시점에서 스냅샷과 엔티티를 비교하여 변경사항만을 DB 에 반영한다. 기존 엔티티 수정 메커니즘은 다음과 같다. 트랜잭션을 커밋하기 전, 엔티티 매니저 내부에서 flush() 를 먼저 호출한다. 엔티티와 스냅샷을 비교해서 변경 지점을 찾는다. 변경사항이 있는 경우 쓰기지연 SQL 저장소에 SQL 문을 생성해서 저장해 둔다. DB에 비로소 commit 될 때, SQL Query 를 DB로 보내서 실제로 반영한다. 벌크 수정 메커니즘 그러나 벌크 작업은 앞서 설명했던 것처럼 영속성 ..