Then the idea of the rail is to support the shaft during the time it is being powered i.e. taking on energy. It is as you know at this time when bending/wobbling is induced. The rail will stop the shaft bending down which in turn reduces the upwards bending. The shaft length can in this case be anything up to about 1/2 the rail length.
A basic rule of thumb is that the longer the shaft the more accurate it should be in an ideal world. However there are many factors which will have an affect on accuracy, momentum and speed of the shaft. Some like shorter/fatter (stiffer) while some will like long thin shafts on the same gun. The goal is to eliminate shaft whip/wobble in flight, hence foxfish's wonderful enclosed track composite gun that uses a thin shaft (fast shaft speed needing less power used for smaller fish

)
Shaft trajectory is dependant on its speed and aqua-dynamics