Gateway timeout is script problem or table corruption?