Drupal数据库结构-高效/低效率? [英] Drupal Database Structure - Efficient/Inefficient?

查看:56
本文介绍了Drupal数据库结构-高效/低效率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当然不是Drupal专家,但是我之前曾计划和构建过一些数据库,所以对于第3方团队正在研究的数据库结构感到困惑,我将Sequel Pro加入其中虚拟内容.我想如果要使用Drupal的后端GUI的话,这种结构就不会很明显了,但是我没有资格,只有ftp和ssh访问.

I'm certainly no Drupal expert, but I've schemed and built a few databases before, so am puzzled by the structure of a database a 3rd party team is working on that I had Sequel Pro'd into to add some dummy content. I presume the structure wouldn't be apparent if one were to use Drupal's back end GUI, but I don't have creds, just ftp, and ssh access.

我不敢看到我没有期望的单个表,例如一个组织,其中包含ID,名称,地址,电子邮件,邮政编码等列.

I was a bit horrified to see not the single table I would have expected for, say, an Organization, with columns for ID, Name, Address, Email, Zip Code, etc. etc.

相反,每个数据位都有一个表.也就是说,有一个单独的表,用于名称",地址",电子邮件",邮政编码"等.

Instead, there is a table for each bit of data. That is, a separate table for Name, for Address, for Email, for Zip Code, etc. etc.

从逻辑的角度来看,这似乎效率极低.例如,当加载组织页面时,从另一张表调用并汇总为该组织加载的每一位数据,而不是通过调用单个表的方式进行汇总,所有数据都从一行中提取.

That seems, from a logical standpoint, amazingly inefficient. E.g., when an Organization page loads, each bit of data that loads for that org is called from a different table and aggregated, rather than by way of a call to a single table, and all data pulled from one row.

我是笨手笨脚的(是,但是...)还是Drupal独有的某些db结构?

Am I clueless (yes but...) or is this some db structure peculiarity unique to Drupal?

推荐答案

是. Drupal将字段内容存储在单独的表中,以使其具有最大的灵活性(例如,如果您希望稍后在组织"之外的其他内容类型上重复使用这些字段),则该内容已经存在于多联接表中.权衡是性能,Drupal则通过缓存来弥补(例如,在加载该Organization节点时,它会对其进行缓存),这样,如果再次在该页面请求中加载它,则无需再次从这些表中读取数据,例如例子).由于它是功能强大的CMS,可让您构建,重新构建和重组存储内容和字段的方式,因此它可以更灵活地存储数据.

Yes. Drupal stores field content in individual tables so that it will be maximally flexible (for example, if you wanted to re-use those fields on other content types besides "organization" later), it is already in a multi-join table. The tradeoff is performance, which Drupal makes up for with caching and such (for example when that Organization node is loaded, it caches it so that if it's loaded again in that page request it doesn't need to read from those tables again, for example). Since it's a powerful CMS that lets you build and re-build and reorganize how you store your content and fields, it stores the data more flexibly.

这篇关于Drupal数据库结构-高效/低效率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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