Disjoint Set Union (DSU) is a tree data structure, which is used to effectively deal with the problems of merging and querying disjoint sets. The DSU algorithm can be used to merge sets and query to which set the node belongs. The DSU algorithm is usually implemented using arrays and tree structures, but there are also methods that use hash tables. The DSU algorithm has a wide range of applications in the connectivity of graph theory, social network and image processing. It helps researchers better understand and analyze set operations, provides a basis for subsequent work, and promotes the solution and optimization of various problems in the field. At the same time, in the programming competition of college students, the use of DSU is more frequent, usually the use of set query is more, resulting in high time complexity and unable to solve the problem quickly. Therefore, path compression strategy is introduced to significantly improve the efficiency of set query. Finally, the application of path compression in union search is introduced in the form of programming competition.