  The discovery of the radioactively powered kilonova AT2017gfo, associated
with the short-duration gamma-ray burst GRB 170817A and the gravitational wave
source GW170817, has provided the first direct evidence supporting binary
neutron star mergers as crucial astrophysical sites for the synthesis of heavy
elements beyond iron through $r$-process nucleosysthesis in the universe.
However, recent identifications of kilonovae following long-duration gamma-ray
bursts, such as GRB 211211A and GRB 230307A, has sparked discussions about the
potential of neutron star-white dwarf mergers to also produce neutron-rich
ejecta and contribute to the production of heavy $r$-process elements. In this
work, we estimate the contribution of binary neutron star mergers to the total
mass of $r$-process elements in the Milky Way and investigate the possibility
of neutron star-white dwarf mergers as alternative astrophysical sites for
$r$-process nucleosynthesis through an analysis of the total mass of the
$r$-process elements in the Milky Way. Our results reveal that binary neutron
star mergers can sufficiently account for the Galactic heavy $r$-process
elements, suggesting that these events are the dominant contributor to the
production of heavy $r$-process elements in the Milky Way. Considering the
total mass of $r$-process elements in the Milky Way and the higher occurrence
rate of neutron star-white dwarf mergers, it is unlikely that such mergers can
produce a significant amount of neutron-rich ejecta, with the generated mass of
$r$-process elements being lower than $0.005M_{\odot}$.
