3. In $\triangle A B C$, it is known that $A B=\sqrt{39}, B C=6$, $C A=\sqrt{3}$, $M$ is the midpoint of side $B C$, and a perpendicular line is drawn from point $B$ to the extension of $A M$, with the foot of the perpendicular being $D$. Then the length of segment $B D$ is $\qquad$
3. $\frac{3}{2}$.

From the given condition, we know $A B^{2}=B C^{2}+C A^{2}$. By the converse of the Pythagorean theorem, $\angle A C B=90^{\circ}$.
By the Pythagorean theorem, we have
$$
A M=\sqrt{A C^{2}+C M^{2}}=2 \sqrt{3}=2 A C \text {. }
$$

Therefore, $\angle D M B=\angle C M A=30^{\circ}$. Hence, $B D=\frac{1}{2} B M=\frac{3}{2}$.