리자

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

· 2011-03-31 (목) 14:23:07 · 3215 · 2
제목과 같은 쿼리문에서

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>
|

댓글 2개

좋은 정보 고맙습니다.
2011-05-05 (목) 22:29:29
인덱스가 있는 경우인가요?
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.
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

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

+
분류 제목 글쓴이 날짜 조회
JavaScript 11-04-28 조회 2,314
JavaScript 11-04-28 조회 2,625
기타 11-04-28 조회 2,456
MySQL 11-04-25 조회 7,443
기타 11-04-22 조회 2,571
MySQL 11-04-22 조회 2,501
PHP 11-04-21 조회 2,723
MySQL 11-04-21 조회 3,183
Flash 11-04-20 조회 2,438
기타 11-04-19 조회 2,061
JavaScript 11-04-13 조회 2,261
jQuery 11-04-12 조회 2,608
PHP 11-04-12 조회 2,284
PHP 11-04-11 조회 3,568
MySQL 11-04-08 조회 3,398
기타 11-04-01 조회 3,938
MySQL 11-03-31 조회 3,216
기타 11-03-30 조회 2,653
JavaScript 11-03-27 조회 2,724
JavaScript 11-03-27 조회 2,546
Flash 11-03-21 조회 2,390
MySQL 11-03-20 조회 3,450
기타 11-03-19 조회 2,770
Flash 11-03-18 조회 2,344
기타 11-03-17 조회 4,074
기타 11-03-17 조회 3,769
기타 11-03-17 조회 2,823
기타 11-03-17 조회 2,251
기타 11-03-15 조회 4,176
JavaScript 11-03-14 조회 1,818