The only thing I can add to your solution is that you can first try to find the exact match in the city tables, and if not, then join the alias. This way you can skip some connections that are quite expensive.
Another point is that this dual desktop solution may have problems with duplicate recordings. I'm not talking about the same aliases for different cities (this can be checked using a unique column), but aliases that correspond to city names. An example of these "duplicate entries" followed by a detailed explanation:
City
ID | Name --------- 1 | Los Angeles 2 | New York
Aliases
ID | CityId | Name ------------------ 1 | 1 | LA 2 | 2 | NY 3 | 2 | Los Angeles
I know this should not happen ... but you know Moore’s laws :) These duplicate crosstabs can cause problems in the lookup table (I think you use them as a look at the “guess” that the City was actually trying to select a user when he wrote "LA"). But if the user wrote "Los Angeles", you have to decide whether to set priorities for the city or pseudonym. I know that the example I presented is a little stupid, but as a non-American citizen, I cannot provide the best examples. But there are many cities with many aliases for each ... I would not risk it :)
Checking the first table of the city will give the city priority over an equal alias name for another city. Or you can check if an alias is present in the city as the name of the city before inserting it.
That's all I can think of :)
source share