<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>IT7C</author_name>
  <author_url>https://blog.hatena.ne.jp/IT7C/</author_url>
  <blog_title>イノベートな非日常</blog_title>
  <blog_url>https://it7c.hatenadiary.org/</blog_url>
  <categories>
    <anon>mysql</anon>
  </categories>
  <description>MySQLでビックデータを扱う場合、データをサンプリングしたいことがある。MS-SQL Serverなどではサンプリング関数が用意されているが、MySQLにはない。 SELECT * FROM report ORDER BY RAND() LIMIT 5 と単純にクエリを書くこともできるが、ビックデータでこれをやるとMySQLがfilesortで死んでしまう。 http://d.hatena.ne.jp/naoya/20051118/1132279240 SELECT * FROM `report` rp, (SELECT ROUND(RAND()*@max) as report_id FRO…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fit7c.hatenadiary.org%2Fentry%2F20130416%2F1366048036&quot; title=&quot; 裏MySQL MySQLでサンプリング あれこれ - イノベートな非日常&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-04-16 02:47:16</published>
  <title> 裏MySQL MySQLでサンプリング あれこれ</title>
  <type>rich</type>
  <url>https://it7c.hatenadiary.org/entry/20130416/1366048036</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
