4. Let $z$ be a complex number. If $\frac{z-2}{z-\mathrm{i}}$ (where $\mathrm{i}$ is the imaginary unit) is a real number, then the minimum value of $\mid z+3$ | is $\qquad$ .


4. $\sqrt{5}$.

Let $z=a+b \mathrm{i}(a, b \in \mathbf{R})$.
From the condition, we have
$$
\begin{array}{l}
\operatorname{Im} \frac{z-2}{z-\mathrm{i}}=\operatorname{Im} \frac{(a-2)+b \mathrm{i}}{a+(b-1) \mathrm{i}} \\
=\frac{-(a-2)(b-1)+a b}{a^{2}+(b-1)^{2}} \\
=\frac{a+2 b-2}{a^{2}+(b-1)^{2}}=0 \\
\Rightarrow a+2 b=2 .
\end{array}
$$

Then $\sqrt{5}|z+3|$
$$
\begin{array}{l}
=\sqrt{\left(1^{2}+2^{2}\right)\left((a+3)^{2}+b^{2}\right)} \\
\geqslant|(a+3)+2 b|=5 \\
\Rightarrow|z+3| \geqslant \sqrt{5} .
\end{array}
$$

When $a=-2, b=2$, $|z+3|$ reaches its minimum value $\sqrt{5}$.