8. Rearrange the six-element array $(1,2,3,4,5,6)$ to
$$
\begin{array}{l} 
A=\left(a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}\right), \\
\text { and } \quad B=\left(b_{1}, b_{2}, b_{3}, b_{4}, b_{5}, b_{6}\right) .
\end{array}
$$

Then the minimum value of $P=\sum_{i=1}^{6} i a_{i} b_{i}$ is
8. 162 .

From the geometric mean
$$
G=\sqrt[6]{\prod_{i=1}^{6} i a_{i} b_{i}}=\sqrt[6]{(6!)^{3}}=12 \sqrt{5} \in(26,27),
$$

we know that there exists at least one term not less than 27, and at least one term not greater than 25.
Let $i_{1} a_{i_{1}} b_{i_{1}} \leqslant 25, i_{2} a_{i_{2}} b_{i_{2}} \geqslant 27$.
$$
\begin{array}{l}
\text { Then } P \geqslant\left(\sqrt{i_{2} a_{i_{2}} b_{i_{2}}}-\sqrt{i_{1} a_{i_{1}} b_{i_{1}}}\right)^{2}+ \\
2\left(\sqrt{i_{1} a_{i_{1}} b_{i_{1}} i_{2} a_{i_{2}} b_{i_{2}}}+\sqrt{i_{3} a_{i_{3}} b_{i_{3}} i_{4} a_{i_{4}} b_{i_{4}}}+\right. \\
\left.\sqrt{i_{5} a_{i 5} b_{i 5} i_{6} a_{i_{6}} b_{i_{6}}}\right) \\
\geqslant(3 \sqrt{3}-5)^{2}+6 \sqrt[6]{(6!)^{3}} \\
=0.19^{2}+72 \sqrt{5}>161 \text {. } \\
\end{array}
$$

Thus, $P \geqslant 162$, and the equality holds when
$$
A=(4,6,3,2,5,1) \text { and } B=(6,2,3,4,1,5) \text {. }
$$

Therefore, $P_{\min }=162$.