If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > CLOB vs VARCHAR - which uses less disk space

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-17-04, 03:46
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
CLOB vs VARCHAR - which uses less disk space

Hi,

I have to save some big texts into database. Now I have a table with column defined as CLOB with 10 MB. In that table is also some other columns, but are not problematic. In table is 300.000 rows which occupy 22 GB of disk space. Disk space is the problem. Would it be better to define VARCHAR field instread of CLOB? Would VARCHAR reduce the disk space used?

My system: DB2 v8 fp2 on Windows 2000

Thanks,
Grofaty

Last edited by grofaty; 06-17-04 at 03:49.
Reply With Quote
  #2 (permalink)  
Old 06-17-04, 09:42
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by grofaty
Hi,

I have to save some big texts into database. Now I have a table with column defined as CLOB with 10 MB. In that table is also some other columns, but are not problematic. In table is 300.000 rows which occupy 22 GB of disk space. Disk space is the problem. Would it be better to define VARCHAR field instread of CLOB? Would VARCHAR reduce the disk space used?

My system: DB2 v8 fp2 on Windows 2000

Thanks,
Grofaty
It would, but not significantly... you no longer need the LOB locator. I also think DB2 makes a better effort to "stuff" the page full with VARCHARs than LOBs (although someone would have to confirm that).

I found a very significant difference in INSERT and SELECT performance when using VARCHAR instead of LOB, presumably due to the bufferpool usage. VARCHARs are much faster to access. Of course, if your system is memory constrained, you could fill up the bufferpool with these large VARCHARs leaving little room for anything else... it's a balance.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #3 (permalink)  
Old 06-18-04, 01:24
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

So LOB fields does not use bufferpool and VARCHAR fileds does?

Thanks,
Grofaty
Reply With Quote
  #4 (permalink)  
Old 06-18-04, 08:52
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by grofaty
Hi,

So LOB fields does not use bufferpool and VARCHAR fileds does?

Thanks,
Grofaty
Correct. (except LONG VARCHAR, it doesn't)
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #5 (permalink)  
Old 06-20-04, 02:38
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

J Petruk, thank you very much.

Thanks,
Grofaty
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On