Let me know because I am focusing on searching form and taking advantage of thinking sphinx as well as for strained characteristics it appears like only integers are recognized but my nations are saved within the db as strings that contains their names.

So I'll be creating my very own country list with strings to exhibit within the choose menu and values as integers to keep within the db. Just wondering why the developer from the jewel (ruby on rails) that I am using made the decision to produce an assortment that contains just strings.

This is not programming language specific. A database is really a database.


I recommend to achieve the nations inside a separate table by having an unique ID designated to all of them. It can make no harm however , does result in the database structure more flexible. By doing this you can include more details associated with the nations just in case you have to, and relate other tables for them, if you want to.

It could be also a performance problem to find information about rows with a string. Querying another table to obtain the country ID's shouldn't create an excessive amount of pressure.

obviously the nation title will be string, exactly that whether directly make use of the country title as primary key, or use another column of integer as primary key

my stand is make use of the integer as primary key, to ensure that update of country title later could be simpler (despite the fact that unlikely but tend to happen). for the issue of searching according to country title, just create a catalog onto it.

Storing a primary research table using the integer mapping of the country could be better. Then your country could be recommended in other tables because the country id(integer).

One reason happens when we attempt to gain access to data associated with a rustic then evaluating the query country string from the actual string saved in DB is much more costly comparison as in comparison to evaluating just two amounts.

I believe you need to keep nations inside a separate table say id, title,short-title and you may use its id for searching..

My own opinion is it would fit more when storing country names like a string inside a databese because country names don't change (usually) and you will find no "updates" in it.

So it could be legit to keep them as strings.