如何减小此Sql表的大小 [英] How Can I Reduce The Size Of This Sql Table

查看:89
本文介绍了如何减小此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表的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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