GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  Database Administration

 Print  |  
Question:  Is VARCHAR2 size optimization worthwhile ?

Answer: Hi, I've recently commissioned a hosted system from a developer who has recommended using J2EE and Oracle. Their J2EE system is quite slick and works very well in preproduction. It uses annotations to generate the Oracle tables on the fly during deployment. On examination of the table structures that it's generated though, it's defaulted all of the VARCHAR2 definitions to 255 characters. On asking the developer about this, his argument is that storage is pretty much a commodity nowadays so it wasn't worth the trouble of defining and optimizing every field (there are hundreds). Furthermore VARCHAR2 only uses the number of bytes required to hold the value stored and wouldn't take up the full 255 anyway, so 255 is just a max value. I'm concerned that this non-optimized table definition might have a performance impact when we go live and I'm considering engaging in an exercise to go through every VARCHAR2 field and tune it to the size of the data that will be stored. What are people's opinions here ?


December 12, 2007 08:38:12 #1
 kailasTile   Member Since: December 2007    Total Comments: 4 

RE: Is VARCHAR2 size optimization worthwhile ?
 
Changing VARCHAR2(255) to precise required width is good table design. Though it will not improve performance as such.
     

 

Back To Question