I have a lookup table, which is the main table of id-value pairs. This table is used to store static data, such as: all countries, currencies, etc.
So other tables have currency_id, country_id.
I have a complex sql that returns a bunch of such identifiers. To get the actual values, there are 2 options:
1. Use a connection to the lookup table
2. In the project, the previous developer implemented a function in which he has a transfer class for a country, a transfer class for a currency, etc.
Therefore, it simply extracts the identifier from the sql result set and looks up the value using the enum class. In his opinion, this is happening faster.
I can, of course, determine by setting the start and end time, which is faster, sql join or enum lookup.
But without doing this, is it possible to predict which one will be faster?
source share