Drupal 数据库结构 - 高效/低效?

2024-04-15数据库问题
6

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

问题描述

我当然不是 Drupal 专家,但我之前设计并构建了一些数据库,所以我对 3rd 方团队正在研究的数据库结构感到困惑,我让 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 独有的一些数据库结构特性?

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

推荐答案

是的.Drupal 将字段内容存储在单独的表中,以便它具有最大的灵活性(例如,如果您以后想在除组织"之外的其他内容类型上重用这些字段),它已经在一个多连接表中.权衡是性能,Drupal 通过缓存等方式弥补了这一点(例如,当加载该组织节点时,它会缓存它,以便如果在该页面请求中再次加载它,则不需要再次从这些表中读取,例如例子).由于它是一个功能强大的 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 数据库结构 - 高效/低效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Mysql目录里的ibtmp1文件过大造成磁盘占满的解决办法
ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致...
2025-01-02 数据库问题
151

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

MySQL groupwise MAX() 返回意外结果
MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)...
2024-04-16 数据库问题
13

MySQL SELECT 按组最频繁
MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)...
2024-04-16 数据库问题
16

为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)...
2024-04-16 数据库问题
13

MySQL GROUP BY DateTime +/- 3 秒
MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)...
2024-04-16 数据库问题
14