Oracle版本Oracle Database 11g Enterprise Edition Release 11.2.0.2.0
硬件8c65g
数据库有lob但是不查询lob io操作大概146
数据库有lob并且查询lob io操作大概1007
通过这个结论可以看出lob是很影响表的查询性能的,如果一个张表里面有要用到lobWEB前端 iis7站长之家,建议独立出一张表,这样即使查询非lob字段也不会影响查询的性能
Lob能不用尽量别用,可以用静态文件代替
详细报告如下:
表无LOB字段 < 表有LOB字段但不选 < 表有LOB字段且选
下面每张表里都有1000条数据
SQL>desc prod_data2.lob_cost_test_0
------------------------------------------------- ----------------------------
ID NUMBER
SQL>desc prod_data2.lob_cost_test_1
Name Null? Type
------------------------------------------------- ----------------------------
ID NUMBER
TEXT VARCHAR2(1000)
selectid, text
from
prod_data2.lob_cost_test_1
call count cpu elapsed disk query current rows
------------- -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 1 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 68 0.00 0.00 0 73 0 1000
------------- -------- ---------- ---------- ---------- ---------- ----------
total 70 0.00 0.01 0 74 0 1000
selectid, text
from
prod_data2.lob_cost_test_0
call count cpu elapsed disk query current rows
------------- -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 1 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 68 0.00 0.00 0 145 0 1000
------------- -------- ---------- ---------- ---------- ---------- ----------
total 70 0.00 0.00 0 146 0 1000
selectid, text, fulltext
from
prod_data2.lob_cost_test_0
call count cpu elapsed disk query current rows
------------- -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.01 0.04 1 1 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1001 0.02 0.05 3 1006 0 1000
------------- -------- ---------- ---------- ---------- ---------- ----------
total 1003 0.04 0.10 4 1007 0 1000