Upvote:2
From this GOV document:
At the border, passenger name records data is retained for 5 years. Advance passenger information may be retained for 10 years.
Note: Just because the API isn't retained, they can still know you are the same person.
It also states:
We will keep your personal information for as long as it is necessary for permitted purposes. In the Borders, Immigration and Citizenship System, we maintain a long-term record of immigration history and immigration offending to support future decision-making and enforce penalties.
Donβt assume that your data is no longer held just because 10 years have passed. Follow gov.uk advice and apply for a visa.