• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of char versus varchar

 
arvindh seshadri
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

we are performing a batch operations of insert and update . The volume of records is around 500,000. We found that the performance degrades if we use char against varchar in the tables.why is it so and What is the best practice ?



Thanks
Arvindh
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probabely because, CHAR uses fixed sizes. Which means, for example, if you store 'ABCD' in a CHAR(50) field, it will be stored as 'ABCD' padded with 46 spaces.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More specifically, this means that you can get less database rows per block of memory. The computer has to read from disk more times to get the same number of results.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic