CLOB: Why are they so slow (compared with VARCHAR2)
From: Mat Hess <nospam_at_nfdshlashjdaurewwehfwhui4wdsafih.ch>
Date: Mon, 17 Jan 2005 10:22:55 +0100
Message-ID: <tk0nu0psun9egv82fqa809pjm2d2orho38_at_4ax.com>
We are currently developing a new application. In this application, we have a table which will hold a large number of rows, where many text fields (one text field per row) will be stored. The users would prefer to have an unlimited field size (in spite of the fact that most of all fields have much less than 4000 characters), so we chose CLOB as the datatype of the corresponding column.
2. Is there a way to improve the performance of the CLOB Fields ?
Date: Mon, 17 Jan 2005 10:22:55 +0100
Message-ID: <tk0nu0psun9egv82fqa809pjm2d2orho38_at_4ax.com>
We are currently developing a new application. In this application, we have a table which will hold a large number of rows, where many text fields (one text field per row) will be stored. The users would prefer to have an unlimited field size (in spite of the fact that most of all fields have much less than 4000 characters), so we chose CLOB as the datatype of the corresponding column.
We experienced very poor performance when we were using CLOB field, compared with VARCHAR2. Please try the following:
create table test (test_text clob)
/
insert into test values ('this is just a test')
-- REPEAT THE INSERT 2000 TIMES
/
In my Database, a SELECT * FROM test takes 0.890 seconds. If I run the same script, but use VARCHAR2(4000) for the test_text column, then the SELECT takes only 0.031 seconds.
My Questions:
2. Is there a way to improve the performance of the CLOB Fields ?
Kind Regards
Mat Hess
Received on Mon Jan 17 2005 - 10:22:55 CET