In the note I'm reading there is the following theorem:
Let $X\subset \mathbb{P}^n$ be a projective variety, and $p_X$ is its Hilbert polynomial. If the dimension of $X$ is $n$, then the leading term of $p_X(m)$ is $$ \frac{\operatorname{deg}X}{n!}m^n $$
However, I tried to test it using the variety $X=\mathbb{V}(x_0)\cup\mathbb{V}(x_1,x_2)\subset\mathbb{P^2}$, and found some problems.
We have $\mathbb{I}(X)=\langle x_0\rangle\cap\langle x_1,x_2\rangle=\langle x_0x_1,x_0x_2\rangle$, thus $$ S(X)=k[x_0,x_1,x_2] / \mathbb{I}(X)\cong k[x_0]\oplus k[x_1,x_2] $$
Thus the Hilbert function is $$ h_X(m)=\operatorname{dim}_k S(X)_{m}=1+(m+1)=m+2 $$
So the Hilbert polynomial is $p_X(m)=m+2$, which indicates that the degree of $X$ is $1$, because the dimension of $X$, which is the maximal dimension of its irreducible component, is $1$.
However, the geometric definition of degree is the maximal number of intersections between $X$ and a hyperplane in general position with dimension equal to the codimension of $X$, in this case $1$. Since $X$ is just the union of $x_0$-axis and the $(x_1,x_2)$-plane, one can easily see the degree of it should be 2.
Could any tell me what goes wrong here?
Updated: following is my geometric intuition: The line $L\in\mathbb{P}^2$ intersects $X$ at two points: $L_1$ and $L_2$(which is the $x_0$-axis).