I have read a article that claim varchar(10000) would use more ram than varchar(50), but I have doubt with it. I have run a simple test:
- create table 'big' with one field varchar(16383)
- create table 'small' with one field varchar(50)
- insert same data to both table
- run 'select *' for each table, see its executing time
- run 'SELECT CONCAT(TRUNCATE(SUM(data_length),2),'B') AS data_size FROM information_schema.tables' for each table, see its data_size
The results of step 4 and step 5 is exactly the same between tables. I have running MySQL 8.0 with innodb. Is there actually has different with varchar(50) and varchar(10000) during query process?