sqlite db中空列的空间消耗 [英] space consumption of null columns in sqlite db

查看:25
本文介绍了sqlite db中空列的空间消耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个 db 列,它很少被我的 sqlite db 中的记录使用(对于其余的记录,值为空),这些空列消耗的空间是否与这些列不存在的情况相当?

Say I have a db column that's only used rarely by records in my sqlite db (for the rest of the records, the value is null), would those null columns consume as much space comparable to if those columns were non-existent?

推荐答案

在我的测试程序中,NULL 值每行消耗了一个字节.如果表中的平均行大小将超过 100 字节,那么是的,它相当于不存在.

In my test program, NULL values have consumed one byte per row. If the average row size in your table will be above 100 bytes, then yes, it's comparable to nonexistent.

这篇关于sqlite db中空列的空间消耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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