select ... from a inner join b where a.name = b.name > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

select ... from a inner join b where a.name = b.name 정보

MySQL select ... from a inner join b where a.name = b.name

본문

제목과 같은 쿼리문에서

a.name 은 char(10) 이고
b.name 은 char(20) 인 경우

b.name 이 char(10) 인 경우 보다 속도가 빠르지 않다고 합니다.

필드의 속성은 이렇게 바꿀 수 있습니다.

alter table a modify name char(10);
alter table a change name name char(10);<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]</div>
추천
0

댓글 2개

인덱스가 있는 경우인가요?
http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

To retrieve rows from other tables when performing joins. MySQL can use indexes on columns more efficiently if they are declared as the same type and size. In this context, VARCHAR and CHAR are considered the same if they are declared as the same size. For example, VARCHAR(10) and CHAR(10) are the same size, but VARCHAR(10) and CHAR(15) are not.
전체 50
개발자팁 내용 검색 MySQL에서

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT