hi all,
I have a project I am working on for a client where she can basically offer different languages on her website. So I have created a table that holds different phrases and words.
Right now I have about 200 fields, and need to add about another 100.
Can there be too many fields (not rows)? Also, would having 300 fields in a table slow it down? Basically i would just query the table (*) and display the variables where needed.
Thanks!
Tim
Too many fields?
Moderator: General Moderators
Personally I'd make my phrase table keyed on Phrase ID and Language.feyd wrote:that many fields can certainly slow it down if you're selecting all of them. I'd probably go for a more normalized approach where the table has maybe four fields: a table ID, a language ID, a phrase ID and the phrase itself.
Code: Select all
CREATE TABLE T_LITERALS (
ID_LITERAL VARCHAR(50) NOT NULL,
ID_LANG CHAR(2) NOT NULL,
DE_LITERAL VARCHAR(255) NOT NULL,
PRIMARY KEY (ID_LITERAL, ID_LANG));So, for example, your table might look like:
Code: Select all
HOMEPAGE_WELCOME EN Welcome to my website!
HOMEPAGE_WELCOME IT Benvenuto al mio sito!
HOMEPAGE_WELCOME DE Wilkommen im meine Website!
...