Re: VARCHAR vs. TEXT - some performance numbers
Thank you for your benchmarks. It is indeed very interesting.
The answer to your first question is partially in the manual partially in your second question. MySQL needs to allocate TEXT column separately which causes some overhead, but I guess it is minimal. The main difference is - "using index" vs not using it - for TEXT case MySQL needs to perform row read, with VARCHAR it only does index read. This is because you do not have full index on TEXT column, so you can't retrieve full row from it in all cases which makes MySQL to use data file. It can't partially use index - even if 99.9% values can be read from index directly it is not enough.
It would be interesting to see results for prefix index in both cases, ie index first 100 characters. I guess difference must be less.
Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog -
http://www.mysqlperformanceblog.com
MySQL Consulting
http://www.mysqlperformanceblog.com/mysql-consulting/
Subject
Views
Written By
Posted
246326
July 31, 2006 06:57AM
Re: VARCHAR vs. TEXT - some performance numbers
66288
July 31, 2006 07:51AM
39143
July 31, 2006 09:48AM
29227
June 16, 2009 01:12PM
31805
June 16, 2009 10:17PM
29852
June 16, 2009 10:25PM
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.