MySQL Forums
Forum List  »  Performance

Re: text vs varchar
Posted by: Øystein Grøvlen
Date: May 02, 2016 04:37AM

Hi Rick,

No, I am referring to that when a row is read from storage engine into MySQL server, the size of the buffer allocated for the row is the maximum row size. However, only the column values that are actually needed will be copied into this buffer. So more memory will be allocated than if TEXT was used instead of VARCHAR.

I did not consider temporary tables in my answer since the question stated that such columns would only be fetched by look-up on primary key. If so, temporary tables should not apply. It is also the case that for temporary tables with VARCHAR(n) columns where n > 512, MEMORY will not be used. Hence, with respect to temporary tables, behavior should be the same regardless of whether column is VARCHAR(4000) and TEXT.

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

Options: ReplyQuote


Subject
Views
Written By
Posted
2902
April 28, 2016 08:36AM
2545
April 29, 2016 12:41AM
1788
April 30, 2016 11:51PM
Re: text vs varchar
1653
May 02, 2016 04:37AM
1436
May 02, 2016 09:14PM
1583
May 03, 2016 02:19AM
2610
May 03, 2016 04:12AM
1512
May 02, 2016 08:02PM
1724
May 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.