Fix index bug on mysql