Action tables are tied to categories. Other tables are at most two levels, e.g., Keywords -> Search Engines.
We should also demonstrate deep drill down tables, e.g.,
For GeoIP work, I think it would be better to do as follows:
The reason is that to do drill down various level, we have to maintain the idSubtable of the parent, then lookup the child idSubtable and call the API for this idSubtable. I think it is not user friendly and not easy to use. Also, we don't really need drill down all levels, since it is interesting to know: Top cities in a country, Top Regions in a country.
As well as being more user friendly this way, it is also more efficient: to draw the map of Cities in a country, we just need to select 1 datatable. If we store citites in each region separately, then we have to lookup each region separately to load their cities. To Archive periods, we would have to select this way hundreds of blobs...
So, I propose that we keep it to 1 level maximum (similarly to what is done) for ease of use, and performance..
The problem with Country -> City is that in some countries (e.g., Canada and the USA), there are popular names for cities, so a City may exist in 2 or more Regions.
I see, maybe we could append the region name in brackets for these countries?
For now, we can append the region code to cities in the US and Canada, e.g., "Victoria, BC".
I'll investigate what other countries have this phenomena. With MaxMind's GeoIP data, the FIPS code is sometimes meaningless, e.g., "Roubaix (B4)". After I implement #2379, we could do a lookup for any other countries where this makes sense, e.g., "Roubaix, Nord-Pas-de-Calais".
append the region code to cities in the US and Canada, e.g., "Victoria, BC".
Sounds good to limit it to US/Canada at first, then we can do it for others if it is an issue (maybe reusing city names is a north american thing ;)
Closing this ticket, as we prefer to keep level breakdown to 2 levels maximum, until we actually want to add further breakdown levels in Piwik (which is new feature...)
Hopefully GeoIP plans are to work on 2 levels maximum as well as proposed in #2429 ?