Patent attributes
A data storage device includes a flash memory and a flash memory controller. The flash memory controller operates the flash memory to store data, and stores a mapping table to record the mapping information between a plurality of logical addresses and a plurality of physical addresses of the flash memory. The mapping table is divided into a plurality of groups. Some of the groups are categorized into a first type of trim group and some of the logical addresses of each of the groups of the first type of trim group are included in a trim command. The flash memory controller performs the trim on the groups of the first type of trim group.