Please look at the link:
http://www.ballisticsbytheinch.com/9luger.html
It clearly shows that speed increases up til 17" barrel length but at 18" speed starts to drop again.
That's when powder has stopped working on the bullet and friction has gained the upper hand.