  We give general conditions to state the weighted Hardy inequality \[
c\int_{\mathbb{R}^N}\frac{\varphi^2} {|x|^2}d\mu\leq\int_{\mathbb{R}^N}|\nabla
\varphi |^2 d\mu+C\int_{\mathbb{R}^N} \varphi^2d\mu,\quad \varphi\in
C_c^{\infty}(\mathbb{R}^N),\,c\leq c_{0,\mu}, \] with respect to a probability
measure $d\mu$. Moreover, the optimality of the constant $c_{0,\mu}$ is given.
The inequality is related to the following Kolmogorov equation perturbed by a
singular potential \[ Lu+Vu=\left(\Delta u+\frac{\nabla \mu}{\mu}\cdot \nabla
u\right)+\frac{c}{|x|^2}u \] for which the existence of positive solutions to
the corresponding parabolic problem can be investigated. The hypotheses on
$d\mu$ allow the drift term to be of type $\frac{\nabla \mu}{\mu}= -|x|^{m-2}x$
with $m> 0$.
