Hi,
I'm building a city names table in MySQL with about 10K rows to be a Symfony i18n table. Basically, the default culture is en_US and every city in the table is initially of this culture. Over time, I'd like to add to the table only those cities that might have an alternative name in a different language, such as "London (en_US) / Londres (es_ES)", without having to replicate all the city data for each language in separate tables.
Now, from what I understand, Symfony won't automatically pick a fallback default city name if a translation for it doesn't exist. So I need to craft a solution to do the following:
If translation exists, select it.... if not, select the default en_US city name.
So far it seems that I should use COALESCE
. However, as I'm not very familiar with it, I'm wondering if there's any drawbacks to using it a lot? I'm asking this because I'd need to include it every city query which is a very frequent action on my site.
Would be grateful for any views, or even suggestions for doing things in a better way. Thanks.