A locally repairable code (LRC) with locality r allows for the recovery of any erased codeword symbol using only r other codeword symbols. A Singleton-type bound dictates the best possible tradeoff between the dimension and distance of LRCs - an LRC attaining this tradeoff is deemed optimal. Such optimal LRCs have been constructed over alphabets growing linearly in the block length. Unlike the classical Singleton bound, however, it was not known if such a linear growth in the alphabet size is necessary or, for that matter, even if the alphabet needs to grow at all with the block length. Indeed, for small code distances 3 and 4, arbitrarily long optimal LRCs were known over fixed alphabets. Here, we prove that for distances d ≥5, the code length n of an optimal LRC over an alphabet of size q must be at most roughly O(dq3)}. For the case d= 5, our upper bound is O(q2). We complement these bounds by showing the existence of optimal LRCs of length Ωd, rq1+1/ lfloor ( d- 3)/ 2 rfloor ) when d \ r+ 2. These bounds match when d = 5, thus pinning down n = Θ(q2) as the asymptotically largest length of an optimal LRC for this case.