数据库:每种语言的表或带有语言列的一个表 [英] Database: A table for each language or one table with a language column

查看:85
本文介绍了数据库:每种语言的表或带有语言列的一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在mysql中创建一个图书数据库.一本书可以使用不同的语言.而且将有成千上万的书. (而且我离该领域的专业人士还很远,之前只创建了小型和简单的数据库)

I am creating a book database in mysql. One book can have different languages. And there is going to be many thousand books. (And I am far from a pro in this field, only created small and simple databases before)

1)是否足够快,只需创建一个带有language列的表并为其创建索引. 2)还是为每种语言创建表会更快得多.

1) Is it fast enough to just create one table with a language column and create an index for it. 2) Or will it be significantly faster to create a table for each language.

我的直觉(女巫在这个领域并不可靠)告诉我选择第一种方法.我认为将其标准化.看起来更干净,更容易扩展到更多语言.并且它需要更少的编程. 但是,将主要使用英语(也将是bigs收藏),当桌子装满用其他语言书写的书时,会不会花费更多时间来访问这些书?

My intuition (witch is not jet reliable in this field) tells me to go with the first option. I think it is more normalized to. It looks much cleaner and easier to extend to more languages. And it requires less programming. However, it is mainly the English language that are going to be used (It will also be the larges collection), and will it not take more time to access those books when the table is filled books written in other languages?

速度至关重要,因为它将在网站上使用.但是,如果没有明显的性能差异,我宁愿选择简单的方法.

Speed is of some importance since it is going to be used on a website. But if there is no significant performance difference I prefer to chose the easy way.

我猜不会有太多不同的语言,最多5种,最多10种.

It will not be many different languages, 5 max 10, i guess.

推荐答案

仅从表中获取您需要的语言,该表包含您需要的所有语言.

Just only fetch the language you need from the table, which has all the languages you need.

这篇关于数据库:每种语言的表或带有语言列的一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆