Aims. The Zernike wavefront sensor (ZWFS) is a concept belonging to the wide class of Fourier-filtering wavefront sensors (FFWFSs). The ZWFS is known for its extremely high sensitivity and low dynamic range, which makes it a unique sensor for second stage adaptive optics systems or quasi-static aberration calibration sensors. This sensor is composed of a focal plane mask made of a phase shifting dot that is fully described by two parameters: its diameter and depth. We aim to improve the performance of this sensor by changing the diameter of its phase shifting dot. Methods. We begin with a general theoretical framework, providing an analytical description of the FFWFS properties. We then predict the expected ZWFS sensitivity for different configurations of dot diameters and depths. The analytical predictions are then validated with end-to-end simulations. From this, we propose a variation of the classical ZWFS shape that exhibits extremely appealing properties. Results. We show that the ZWFS sensitivity can be optimized by modifying the dot diameter and it can even reach the optimal theoretical limit, though with the trade-off of low spatial frequency sensitivity. As an example, we show that a ZWFS with a 2 λ/D dot diameter (where λ is the sensing wavelength and D the telescope diameter), hereafter called a Z2WFS, exhibits a sensitivity twice higher than the classical 1.06 λ/D ZWFS for all the phase spatial components except for tip-tilt modes. Furthermore, this gain in sensitivity does not impact the dynamic range of the sensor, and the Z2WFS exhibits a similar dynamical range as the classical 1.06 λ/D ZWFS. This study opens the path to the conception of a diameter-optimized ZWFS.