<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>adorechic</author_name>
  <author_url>https://blog.hatena.ne.jp/adorechic/</author_url>
  <blog_title>あん肝ペールエール</blog_title>
  <blog_url>https://adorechic.hatenablog.com/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>ActiveRecord</anon>
  </categories>
  <description>ARのfind_each/find_in_batchesはlimit/offsetをオプションで指定できる。 User.find_each(start: 1000, batch_size: 100) do |user| user.touch end batch_sizeは単純にrelationのlimitにわたされるだけ。 startは&gt;=でprimary keyに対してセットされる。 relation.where(table[primary_key].gteq(start)).to_a</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fadorechic.hatenablog.com%2Fentry%2F2014%2F05%2F01%2F220715&quot; title=&quot; AR#find_eachのlimit/offset - あん肝ペールエール&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>2014-05-01 22:07:15</published>
  <title> AR#find_eachのlimit/offset</title>
  <type>rich</type>
  <url>https://adorechic.hatenablog.com/entry/2014/05/01/220715</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
