对 MySQL 数据库中的表进行分组

发布于 2024-10-08 04:27:37 字数 301 浏览 0 评论 0原文

这是我的思考: 我有一些 ER 图,代表数据库中的数千个表。多个文件中的每个文件中表示的实体具有由设计者决定的某种关联关系。虽然其他文件中的实体之间存在关系,但它们没有映射。这似乎是绘制这种规模的数据库的常见做法。

我正在考虑在 MySQL 数据库中表示这些分组的想法。由于 SCHEMA 是 MySQL 中 DATABASE 的别名,因此我无法找到对数据库中的表进行分组的机制。

我想知道是否有其他人设计了一些创意分组概念并愿意与我分享。或者,更好的是,如果 MySQL 支持某种在数据库中对表进行分组的机制,请告诉我。 (我显然在我的研究中错过了它)

Here's my ponder:
I've got some ER diagrams representing several thousand tables in a database. The entities represented in each of the multiple files have some associative relationship as decided by the designer. While relationships exist between entities in other files, they are not mapped. This seems common practice for diagramming databases of this size.

I was entertaining the idea of representing these groupings in a MySQL database. As SCHEMA is an alias to DATABASE in MySQL, I'm not able to find a mechanism for grouping tables within a database.

I'm wondering if anyone else has devised some creative grouping concept that they would like to share with me. Or, better yet, if MySQL supports some mechanism for grouping tables within a database, please let me know. ( I've apparently missed it in my research )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

秉烛思 2024-10-15 04:27:38

与 Postresql 中的模式可用于将表分组到不同的命名空间不同,MySQL 不支持以前缀以外的任何其他方式构建表。如果您使用像 MySQL Workbench 这样的管理工具,您可以使用 EER 层以可视方式对表进行分组:
https://dev.mysql.com/doc/ workbench/en/wb-using-layer-tool.html

Unlike how Schemas in Postresql can be used to group tables into different namespaces, MySQL does not have native support for structuring tables in any other way than with prefixes. If you are using an admin tool like MySQL Workbench you can however use EER layers to group tables visually:
https://dev.mysql.com/doc/workbench/en/wb-using-layer-tool.html

帅冕 2024-10-15 04:27:38

MySQL 有 MERGE 存储引擎,它可以聚合几个具有相同结构的表。

MySQL has the MERGE Storage Engine, which can aggregate a few tables with the same structure.

蓝海 2024-10-15 04:27:37

您可以对要使用的表使用相同的前缀,例如,您有员工组,您创建了表 emp_main 、 emp_Children 和 emp_tasks ,然后您可以有另一个组,例如您销售的项目,全部以 it_ 开头

You can use the same prefix for the tables you want to use, for example you have employees groups you make the tables emp_main and emp_Children and emp_tasks then you can have another group like items that you sell that starts all with it_

烟沫凡尘 2024-10-15 04:27:37

MySQL 中没有层次结构的概念。 IE。您的数据库没有文件夹、容器或命名空间。

MySQL 有 2 个概念:数据库(通常称为架构)和表。各种软件(例如 PHPMyAdmin)会查看相似性,并根据名称本身将数据库分组到文件夹中。例如,如果您使用下划线 "com_sumeet" phpmyadmin 实际上会将它们分组在一起:

There is no concept of a hierarchy in MySQL. ie. No folders, containers or namespaces for your databases.

MySQL has 2 concepts: A database (Often referred to as a Schema), and tables. Various software (like PHPMyAdmin) will look at the similarities and will group databases together into folders based on the name itself. For example, if you use underscores "com_sumeet" phpmyadmin will actually group those together:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文