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

[20210125] Spring @ControllerAdvice, MySQL Index 옵티마이저(?) #21

Open
JuHyun419 opened this issue Jan 25, 2021 · 0 comments
Open

Comments

@JuHyun419
Copy link
Owner

@ControllerAdvice

@ControllerAdvice 
public class GeneralExceptionHandler {
  // HTTP 405 오류 처리
  @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
  public ResponseEntity<ApiResult<?>> methodNotAllowedHandling(final Throwable throwable) {
    log.error(throwable.getMessage());
    return newResponse(throwable, HttpStatus.METHOD_NOT_ALLOWED);
  }
}

MySQL Index 옵티마이저(?)

  • 다중 컬럼 인덱스가 지정되어 있음
key idx_index(name, address)
  • 실행계획(EXPLAIN)을 봤을때 name 컬럼은 인덱스를 타지만, address는 인덱스를 타지 않음
  • MySQL 내부 알고리즘에 의해 인덱스를 태우는게 효율적인지, 비효율적인지를 판단해서 결정함(?)
  • 확실하진 않음... 깊게 공부해야 할 듯 !!
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