We investigated the influence of thickness of p-GaN layer on the performance of p-i-n structure GaN ultraviolet photodetector. Through the simulation calculation,it was found that both the quantum efficiency and dark current of device decrease when employing thicker p-GaN layer,while both the quantum efficiency and dark current increase with decreasing thickness of p-GaN layer. It is suggested that the Schottky contact junction between the metal and p-GaN may be responsible for the incompatible effect. We has to make a suitable choice of the thickness of p-GaN in the device design according to the application requirement.