如何减小此Sql表的大小

编程入门 行业动态 更新时间:2024-10-28 05:13:39
本文介绍了如何减小此Sql表的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试升级现有数据库以进行在线求职和招聘网站,主要目标是通过添加类别,功能,更好的标签系统和子类别使人们更加智能化的表格 这里是问题所在:每个类别都有自己的子类别和功能,例如当用户看到教学类别的人时,用户可能想知道他们是否私下教学(家庭 - 学校) )所以我为该功能添加了一个类型colume,但是你可能知道,并非所有类别都需要家庭教育功能,例如其他类别,如计算机,工程师,医生和其他东西,这意味着所有这些行都有类别除了教学之外,所有人都会有一个无用的NULL,它们占用1个字节可能听起来不是很多,但最后我可能会在每行浪费空间时遇到大量无用的NULL。 $> i也无法为每个类别创建表,因为人员表有实际情况与其他表如用户,评论,图像等.... 你建议我做什么?

解决方案

现在是时候阅读数据库规范化的一个(或多个)教程了初学者 [ ^ ]。

i am trying to upgrade an existing database for online job finding and hiring website, the main goal is to make the table for people more browsble by adding categories, features, better tag system, and subcategories here is the problem: each category have it's own subcategory and features, for example when a user is seeing people in teaching category, the user might want to find out if they teach privatly(home-school)so i add a bit type colume for that feature, but as you might know, not all categories need a home schooling feature, for example other categories like, computer, engnier, medican and other stuff, that means all of these rows with category other than teaching will all have a useless "NULL" in them that takes a 1 byte that might not sound a lot but at the end i might end up having tons of such useless "NULL"s in each row that wasting space. i also can't create table for each category since the people table have realtions with other tables like users,comments, images and etc.... what do you suggest i do?

解决方案

It's time time to read one (or more) tutorial on "database normalization for beginners"[^].

更多推荐

如何减小此Sql表的大小

本文发布于:2023-10-22 08:48:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1517027.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:大小   Sql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!