A downhole tool includes inner and outer telescoping cylindrical members. The inner cylindrical member has a cylindrical indexing sleeve disposed thereabout. A groove having a semi-circular cross section is disposed in a cylindrical outer surface of the indexing sleeve. Connected to the outer cylindrical member is an apparatus for holding a spherical ball so that approximately one-half the ball is engaged with the semi-circular cross section groove and the other of the ball is disposed within a radial bore in the outer cylindrical member. Relative movement between the inner and outer cylindrical members is defined by engagement of the spherical ball with the groove. The spherical ball is biased toward the groove by a compression spring or a displaceable fluid under pressure.