Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20210313] MySQL - join, 옵티마이저, Java #66

Open
JuHyun419 opened this issue Mar 13, 2021 · 0 comments
Open

[20210313] MySQL - join, 옵티마이저, Java #66

JuHyun419 opened this issue Mar 13, 2021 · 0 comments

Comments

@JuHyun419
Copy link
Owner

JuHyun419 commented Mar 13, 2021

join

  • INNER JOIN -> JOIN
  • JOIN을 사용할 때 기준이 되는 테이블을 잘 설정할 것 !
  • 복잡한 쿼리 작성 시 분할해서 쿼리 작성할 것 !

image
https://yoo-hyeok.tistory.com/98



옵티마이저

  • 규칙 기반 최적화(Rule-based optimizer, RBO)
    • 기본적으로 대상 테이블의 레코드 건수나 선택도 등을 고려하지 않고 옵티마이저에 내장된 우선순위에 따라 실행 계획을 수립하는 방법
    • 통계 정보 조사 X, 동일한 쿼리에 대해서는 거의 항상 같은 실행 방법을 생성함
    • 현재 거의 사용 X
  • 비용 기반 최적화(Cost-based optimizer, CBO)
    • 쿼리를 처리하기 위한 여러 가지의 가능한 방법을 만들고, 각 작업의 비용 정보와 대상 테이블의 예측된 통계 정보를 이용해 각 실행 계획별 비용을 산출
    • 산출된 각 실행 방법별 최소 비용이 소요되는 처리 방식을 선택해 최종 쿼리를 수행
    • 현재 대부분의 RDBMS가 채택하고 있는 옵티마이저



Java - 단일 문자열 정렬, char to int

String str= "java"; 
char[] chArr = str.toCharArray();
Arrays.sort(chArr);
String sortStr= new String(chArr);
System.out.println("before : " + str); 
System.out.println("after: " + sortStr);  

java
aajv


// 'a' => 0, 'z' => 25
int index = Character.getNumericValue(words[i].charAt(j)) - 10;
int index = words[i].charAt(j) - 'a';
@JuHyun419 JuHyun419 changed the title [20210313] MySQL - join, 옵티마이저 [20210313] MySQL - join, 옵티마이저, Java Mar 13, 2021
@JuHyun419 JuHyun419 added the Java label Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant