MySQL Table with TEXT栏 [英] MySQL Table with TEXT column

查看:70
本文介绍了MySQL Table with TEXT栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究数据库,必须处理TEXT字段.

I've been working on a database and I have to deal with a TEXT field.

现在,我相信我已经看到一些地方提到最好将TEXT列与表的其余部分(将其放在自己的表中)隔离开.

Now, I believe I've seen some place mentioning it would be best to isolate the TEXT column from the rest of the table(putting it in a table of its own).

但是,现在我在任何地方都找不到此参考,并且由于它已经有一段时间了,所以我开始认为也许我误解了这些信息.

However, now I can't find this reference anywhere and since it was quite a while ago, I'm starting to think that maybe I misinterpreted this information.

一些研究表明,表明

将文本/斑点与元数据分开,如果不需要,请不要在结果中放入文本/斑点.

Separate text/blobs from metadata, don't put text/blobs in results if you don't need them.

但是,我不熟悉这里使用的元数据"的定义.

However, I am not familiar with the definition of "metadata" being used here.

所以我想知道将TEXT列放在自己的表中是否有任何相关的优点.与其他领域的潜在问题是什么?还有将其保存在单独的表中的潜在问题吗?

So I wonder if there are any relevant advantages in putting a TEXT column in a table of its own. What are the potential problems of having it with the rest of the fields? And potential problems of keeping it in a separated table?

应该相当频繁地搜索(选择)该表(没有TEXT字段). 过早的优化被认为是邪恶的"在这里重要吗? (如果TEXT列中确实有一个惩罚,那么 的相关性如何,考虑到以后在需要时进行更改就很容易了.)

This table(without the TEXT field) is supposed to be searched(SELECTed) rather frequently. Is "premature optimization considered evil" important here? (If there really is a penalty in TEXT columns, how relevant is it, considering it is fairly easy to change this later if needed).

此外,是否有关于此主题的良好链接? (也许是stackoverflow的问题与解答?我曾尝试搜索此主题,但只找到了TEXT vs VARCHAR讨论)

Besides, are there any good links on this topic? (Perhaps stackoverflow questions&answers? I've tried to search this topic but I only found TEXT vs VARCHAR discussions)

推荐答案

是的,似乎您误解了句子的含义.它的意思是,如果您确实需要该字段的内容,则只应执行SELECT,包括TEXT字段.这是因为TEXT/BLOB列可能包含大量数据,需要将这些数据传递给您的应用程序-这需要时间,当然也需要资源.

Yep, it seems you've misinterpreted the meaning of the sentence. What it says is that you should only do a SELECT including a TEXT field if you really need the contents of that field. This is because TEXT/BLOB columns can contain huge amounts of data which would need to be delivered to your application - this takes time and of course resources.

最良好的祝愿, 法比安

Best wishes, Fabian

这篇关于MySQL Table with TEXT栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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