Vitamin D is often treated generically, sometimes even not specifying the index. According to this article, there are five Ds (D1, D2, D3, D4 & D5) and only D2 (ergocalciferol) and D3 (cholecalciferol) can be used by our bodies.
This article goes further and makes a difference between D2 and D3. D3 is clear winner (my emphasis):
The majority of studies that compare, and continue to compare, the
effects of vitamin D2 and D3 all resonate with one statement:
vitamin D3 is far superior for the human body. Research over the last ten years has produced an overwhelming amount of evidence that
vitamin D3 is better absorbed and utilized than D2. Simply put, if you want the best form of vitamin D, choose vitamin D3.
Studies have consistently shown that, functionally, vitamin D3 is at
least 300% more effective than D2. A review of over 50 vitamin D
studies also shows that vitamin D3 offers a noticeable decrease in
overall mortality, significantly surpassing D2 in reducing death rates
from all causes. Vitamin D3 supplementation has also been shown to
maintain serum vitamin D levels in the long run, especially in the
winter months when sunlight is scarce.
Also, see references mentioned in the text (1, 2, 3, 4).
This article (a free account might be required to read it) goes into more medical details related to D3 vs D2 (its target audience is mostly health professionals):
Studies indicate that ergocalciferol (vitamin D2) is much less potent
and has a shorter duration of action than cholecalciferol.
[...] ergocalciferol potency is less than 30% of that of cholecalciferol and
that it has a markedly shorter duration of action.
Conclusion
[...] ergocalciferol (vitamin D2) and cholecalciferol (vitamin D3) are
not bioequivalent and should not be considered interchangeable.
Although few head-to-head trials exist, based on pharmacokinetic
studies and limited clinical evidence, cholecalciferol is preferred
over ergocalciferol.
Recommendation
Health professionals should encourage use of cholecalciferol (D3) over
ergocalciferol (D2) in all patients without severe renal failure, either as
a general supplement or as a treatment for vitamin D deficiency.
Answer to your question:
Yes, vitamin D₂ is less effective than vitamin D₃