<?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>
    <anon>rails</anon>
  </categories>
  <description>前書いた書きかけのメモを発見したので加筆して載せてみます。ちなみにこの話はMysql(InnoDB)利用時限定です。モデルのcountメソッドは SELECT count(*) AS count_all FROM `blogs` のようなSQL文を発行します。このようなSQL文では、基本的に主キーインデックスによる全索引検索が行われます。通常、インデックスだけを読み込む全索引検索のほうが、テーブルだけを読み込む全表検索よりもI/O回数が少なくなるため高速になりますが、InnoDBの主キーインデックスは他の列値と直結している仕様で(この場合は)余計な列値を読み込むことになるため、あまり高速になり…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.willnet.in%2Fentry%2F20090916%2F1253109999&quot; title=&quot;countよりもcount_by_sqlの方がいいかも - おもしろ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/51PGAHRM50L.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-09-16 23:06:39</published>
  <title>countよりもcount_by_sqlの方がいいかも</title>
  <type>rich</type>
  <url>https://blog.willnet.in/entry/20090916/1253109999</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
