<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>patorash</author_name>
  <author_url>https://blog.hatena.ne.jp/patorash/</author_url>
  <blog_title>patorashのブログ</blog_title>
  <blog_url>https://patorash.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Ruby on Rails</anon>
  </categories>
  <description>課題：データを弾くためにN+1問題が発生していた 数年前に実装した、CSVデータをDBにインポートするためのプログラムがありました。 単にインポートするだけならいいのですが、除外リストに登録済のデータは弾いてほしい、という要望があり、そのように実装していました。 以下、ダミーのプログラムです。モデル名やCSVの内容は変えてあります。 require 'csv' csv = CSV.read('list.csv', { headers: true, return_headers: false, skip_blanks: true, encoding: 'UTF-8' }) import_data…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpatorash.hatenablog.com%2Fentry%2F2021%2F07%2F17%2F032507&quot; title=&quot;exists?で起きるN+1問題に対処するためにSetを使った話 - patorashのブログ&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>https://m.media-amazon.com/images/I/5186AWFoSXL._SL500_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-07-17 03:25:07</published>
  <title>exists?で起きるN+1問題に対処するためにSetを使った話</title>
  <type>rich</type>
  <url>https://patorash.hatenablog.com/entry/2021/07/17/032507</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
