week 를 계산하여 파티셔닝 테이블을 만들경우 아래와 같은 문제점이 생길수 있습니다.
SELECT YEARWEEK('2013-01-01',0); ->201253
SELECT YEARWEEK('2013-01-01',1); ->201301
또한 크론등의 os 기준으로 위크를 구할경우 다른 결과 값이 나옵니다.
위크 기준 파티셔닝 테이블을 만들때 고려 해야 할 사항같습니다.
INTERVAL -5 HOUR 등을 사용시 실제 week 구하는 메서드 소스를 까서 확인 할것
------------------상세------------------------------------------------------
1.한주의 시작을 일요일 또는 월요일로 볼것이냐에 따라 주차계산이 다릅니다.
mysql api 입니다.
0 to 53 or from 1 to 53.
Mode First day of week Range Week 1 is the first week …
0 Sunday 0-53 with a Sunday in this year
1 Monday 0-53 with more than 3 days this year
2 Sunday 1-53 with a Sunday in this year
3 Monday 1-53 with more than 3 days this year
4 Sunday 0-53 with more than 3 days this year
5 Monday 0-53 with a Monday in this year
6 Sunday 1-53 with more than 3 days this year
7 Monday 1-53 with a Monday in this year
https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_yearweek
0 을 사용할 경우 1년의 주 0~52
SELECT WEEK('2013-01-01',0); ->0
SELECT WEEK('2013-12-31',0); ->52
1 을 사용할 경우 1년의 주 1~53
SELECT WEEK('2013-01-01',1); -> 1
SELECT WEEK('2013-12-31',1); -> 53