<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>willnet</author_name>
  <author_url>https://blog.hatena.ne.jp/willnet/</author_url>
  <blog_title>おもしろwebサービス開発日記</blog_title>
  <blog_url>https://blog.willnet.in/</blog_url>
  <categories>
    <anon>mysql</anon>
  </categories>
  <description>mysqlのデータ型の一つvarcharは可変長の文字列を格納します。なので、最大長をいくつに設定してもハードディスク的に必要な容量は同じです。例えば'hello'という文字列を格納するとしたら varchar(5) varchar(200) のどっちの定義でも必要なのは5文字分の容量(と文字数を格納する容量)です。ではわざわざ最大長を考えて設定する意味はあるのでしょうか？いつでもvarchar(255)にしておけば問題ないのでは？と疑問に思ったので調べてみました。 やっぱり最大長は必要な分だけ確保すべき 最大長が大きいと、mysql内部で値を保持するときのメモリ容量が大きくなる可能性があるら…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.willnet.in%2Fentry%2F20100205%2F1265387584&quot; title=&quot;varcharの最大長を必要な分だけ設定する意味 - おもしろwebサービス開発日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://ecx.images-amazon.com/images/I/51Dw93-VRFL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-02-05 01:33:04</published>
  <title>varcharの最大長を必要な分だけ設定する意味</title>
  <type>rich</type>
  <url>https://blog.willnet.in/entry/20100205/1265387584</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
