Blob数据类型? [英] Blob Data Type?

查看:103
本文介绍了Blob数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

blob数据类型也可以存储视频数据吗?

Can blob data type store the video data also?

推荐答案

将视频存储在SQLite数据库中是一个可怕的想法。不要这样做。



不要将大型BLOB放在数据库中。将它们放在数据库文件旁边的文件系统中,然后将文件名或URL写入数据库。这将更快,将更有效地使用数据库,将I / O最小化(因为视频将不必分解为数据库的分页方案,并将使视频管理更容易(文件系统删除的文件 ton 比必须删除包含BLOB的一堆页面的数据库更快。

Storing video in a SQLite database is a horrible idea. Don't do it.

Don't put large BLOBs in a database. Put them in the filesystem next to your database file and then write the filenames or an URL to the database. This will be a ton faster, will use the database much more efficiently, will minimize I/O (in that the video won't have to be broken up into the paging scheme of the database, and will make management of the videos easier (a filesystem delete of a file is a ton faster than a database having to excise a bunch of pages that contain the BLOB).

将BLOB放入数据库是非常低效的,而且很可能会破坏你的应用程序的内存使用(除非你已经想出一种方法将数据从数据库传输到视频解码器)。

Putting BLOBs in the database is horribly inefficient and, quite possibly, will blow out your app's memory use, too (unless you have figured out a way to stream data from the database to the video decoder).

它会产生额外的I / O,使用更多功率,并且在数据库中存储更多项目时性能通常会下降。如果你正在混音在数据库中具有小基准的BLOB,你可以很容易地得到一个病态分散的数据库。自动吸尘将有所帮助,但它更低效,更多的I / O和更多的电池寿命消耗。

It will incur extra I/O, use more power, and performance will generally go to hell as you store more items in the database. If you are mixing BLOBs with small datums in the database, you can quite easily end up with a pathologically fragmented database. Auto-vacuuming will help, but it is yet more inefficiency, more I/O and more battery life consumed.

是的,有数据库可以很好地处理BLOB。它们与这个唯一标记为iPhone的问题完全无关。

Yes, there are databases that handle BLOBs fairly well. And they are completely irrelevant to this question whose only tag is "iPhone".

注意问题的答案处理BLOB和流媒体比文件系统更好漂亮总是要求您使用正在读取/写入原始设备的数据库 - 硬盘驱动器上的分区,它只是数据库内容。任何其他解决方案都必然是现有文件系统之上的一个层,并且即使数据库供应商完成了所有工程工作(并且它是巨大的)以尽可能地匹配它们的数据库访问I / O,也会有成本。底层文件系统语义。

Note that the answer to the question "handles BLOBs and streaming media better than the filesystem" pretty much always requires that you are using a database that is reading/writing to/from a raw device -- a partition on a hard drive that is nothing but database contents. Any other solution will necessarily be a layer on top of an existing filesystem and there will be cost, even if the database vendor has done all the engineering work (and it is huge) to match they database access I/O as much as possible with underlying filesystem semantics.

这篇关于Blob数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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