<?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>PostgreSQL</anon>
    <anon>SQL</anon>
    <anon>Ruby on Rails</anon>
  </categories>
  <description>新たにカラムを追加することになり、その条件が Null許可 ユニークであること ただし論理削除を考慮する となったので、アーハイハイ、部分インデックスですねと思って設定していて、テストもしていたのだけれど、考慮漏れがあったので自戒を込めて書いておきます。 部分インデックスとは インデックスの条件にwhere句を使うことができるやつです。 よくあるパターンでは、メールアドレスで登録されたユーザーがユニークになるようにしてあるけれど、論理削除を考慮する場合などで使われたり、上位500件のデータのみにインデックスを貼りたいとか、そういうときに使います。 -- 論理削除されていないユーザーでメールアド…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpatorash.hatenablog.com%2Fentry%2F2018%2F05%2F16%2F085231&quot; title=&quot;部分インデックスでミスった話 - 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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-05-16 08:52:31</published>
  <title>部分インデックスでミスった話</title>
  <type>rich</type>
  <url>https://patorash.hatenablog.com/entry/2018/05/16/085231</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
