본문 바로가기

DATE_FORMAT 검색의 위험성 SELECT idx FROM t_a WHERE DATE_FORMAT(reg_date, '%Y%m%d') = '2021-03-02' GROUP BY idx; t_a 테이블에 row수는 7천만개가 넘은 상태였다. 어마어마한 row수를 가진 테이블에 위 쿼리를 실행하니 쿼리문이 영원히(!) 실행 되다시피 했다. 그 이유는 WHERE 절..! 'reg_date' 컬럼의 포맷은 YYYY-MM-DD HH:MM:SS 해당 포맷을 변경 후 위 쿼리와 같이 검색을 하게되니 'reg_date' 컬럼을 Like 검색으로 변환되어 모든 컬럼을 샅샅이 조사(?)하기 시작한거 같다. row수가 얼마 안된다면 모르겠지만 row수가 많다면 아래와 같이 검색을 하자..! SELECT idx FROM t_a WHERE reg_date .. 더보기
Speeding up rendering of large html tables 출처: https://www.competa.com/blog/speeding-up-rendering-of-large-html-tables/ Although table seems to have become the black sheep of html tags, it is still a very usefull if used what it was intended for: displaying data in a tabular way. One of the nice features of tables is that one can let the browser handle the width of table cells. The browser starts rendering the table and when it finds tha.. 더보기
WHERE QUERY Performance Tuning 출처: https://link2me.tistory.com/544 WHERE 절은 "테이블내의 모든 행을 검색하는 대신 검색 조건을 지정하여 사용자가 원하는 행들만 검색하는 기능"이다. WHERE 조건식은 단일 조건식과 복수 조건식이 있다. 연산자 의 미 = 같다 WHERE 품목 = '구두' ; > 보다 크다 >= 보다 크거나 같다 더보기