• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sql data type perofrmance  RSS feed

 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm wondering do I influence at performance of database operations and communication with java, if I, let say, specified certain columns to be LONGTEXT, instead of VARCHAR (50) (if both ways satisfies requirement) ?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a question for a database administrator, and most of the people on our site are more in the programming expertise.
My gut reaction is: there may be small differences in performance, but they will probably be negligible compared to practically everything else a non-trivial program will do. Remember, Premature optimization is the root of all evil (Knuth). Don't get hung up on minor details that probably won't make a difference.
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I was just curious about it, and my opinion is the same, but just to consult someone. However thanks in advice...
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your mileage will vary, depending on the database used as well as the version. Not all databases will support things like that, as well. Plus the context of the operations that you do may affect what's optimal.

Most of the major databases have very effective tuning tools, even the free ones. I did some detailed optimization studies on a PostgreSQL database last week, in fact, and was surprised at all the info that it makes available.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!