<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kumanomidox</author_name>
  <author_url>https://blog.hatena.ne.jp/kumanomidox/</author_url>
  <blog_title>Yappli Tech Blog</blog_title>
  <blog_url>https://tech.yappli.io/</blog_url>
  <categories>
    <anon>SQL</anon>
    <anon>サーバーサイド</anon>
    <anon>PHP</anon>
    <anon>Laravel</anon>
  </categories>
  <description>こんにちは、ヤプリでサーバサイドエンジニアをしている熊埜御堂です。 今回は、業務で行ったAPIのパフォーマンス改善について記載します。 TL;DR 何が起きていたか: EXPLAINで event_histories へのクエリが全144パーティションをスキャンしていた なぜ起きていたか: サブパーティションキー（tenant_id）がWHERE句に含まれておらず、MySQLがパーティション剪定できなかった どう直したか: Eloquentの with() に .where('tenant_id', $tenant-&gt;id) を追加 効果: スキャンパーティション数 144 → 9（16倍改善…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.yappli.io%2Fentry%2Fmysql-partition-pruning-not-working&quot; title=&quot;MySQLのパーティション剪定が機能していなかった話 — Eloquentクエリに条件を1行追加して16倍改善 - Yappli Tech Blog&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://cdn-ak.f.st-hatena.com/images/fotolife/k/kumanomidox/20260525/20260525124011.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-05-25 16:00:00</published>
  <title>MySQLのパーティション剪定が機能していなかった話 — Eloquentクエリに条件を1行追加して16倍改善</title>
  <type>rich</type>
  <url>https://tech.yappli.io/entry/mysql-partition-pruning-not-working</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
