MySQL Forums :: Performance :: text vs varchar


Advanced Search

Re: text vs varchar
Posted by: Øystein Grøvlen ()
Date: April 29, 2016 12:41AM

Hi,

I assume you are using InnoDB. With respect to storage, InnoDB will handle VARCHAR and TEXT much the same. Short values will be stored on same page as rest of row, long values will be stored on separate pages.

However, when fetching the data from InnoDB, the server will allocate space for all VARCHAR columns while space for TEXT columns will only be allocated if they are actually read. Hence, if a column is seldom fetched, you will use less memory if TEXT is used.

Hope this helps,

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject Views Written By Posted
text vs varchar 798 hua kai 04/28/2016 08:36AM
Re: text vs varchar 407 Øystein Grøvlen 04/29/2016 12:41AM
Re: text vs varchar 414 Rick James 04/30/2016 11:51PM
Re: text vs varchar 448 Øystein Grøvlen 05/02/2016 04:37AM
Re: text vs varchar 387 hua kai 05/02/2016 09:14PM
Re: text vs varchar 385 Øystein Grøvlen 05/03/2016 02:19AM
Re: text vs varchar 606 hua kai 05/03/2016 04:12AM
Re: text vs varchar 371 hua kai 05/02/2016 08:02PM
Re: text vs varchar 489 Øystein Grøvlen 05/03/2016 02:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.