Oracle large object (lob) type usage performance test

Oracle large object (lob) type usage performance test

Original December 23, 2011 15:33:55

  •  

oracle版本Oracle Database 11g Enterprise Edition Release 11.2.0.2.0

Hardware 8c65g

 

The number of io operations in the database without lob query is about 74

The database has lob but does not query the lob io operation is about 146

The database has lob and the query lob io operation is about 1007         

 

From this conclusion, it can be seen that lob has a great impact on the query performance of the table. If there is a lob data type in a table, it is recommended to separate a table, so that even if the non-lob field is queried, it will not affect the performance of the query.

Lob can not be used as much as possible, you can use static files instead

 

The detailed report is as follows:

 

The COST sort order of the query

Table has no LOB field < table has LOB field but not selected < table has LOB field and selected

 

There are 1000 data in each table below

 

SQL>desc prod_data2.lob_cost_test_0

Name                                     Null?    Type

------------------------------------------------- ----------------------------

ID                                                NUMBER

TEXT                                              VARCHAR2(1000)

FULLTEXT                                          CLOB

 

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325022174&siteId=291194637