Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
pg_stat_statementsで inの数が違うSQLをまとめて ほしい
Search
Yasuo Honda
March 24, 2024
Programming
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
pg_stat_statementsで inの数が違うSQLをまとめて ほしい
第46回 PostgreSQLアンカンファレンス@東京
Yasuo Honda
March 24, 2024
More Decks by Yasuo Honda
See All by Yasuo Honda
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
1
390
私のRails開発環境
yahonda
0
260
Railsの話をしよう
yahonda
0
300
RailsのPostgreSQL 18対応
yahonda
0
4.1k
Contributing to Rails? Start with the Gems You Already Use
yahonda
2
270
PostgreSQL 18 cancel request key長の変更とRailsへの関連
yahonda
0
340
extensionとschema
yahonda
1
380
NOT VALIDな検査制約 / check constraint that is not valid
yahonda
1
330
今、始める、第一歩。 / Your first step
yahonda
3
1.6k
Other Decks in Programming
See All in Programming
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
150
contenteditable と日本語入力に向き合う
colorful12
0
140
Agents on Rails - Rails at Scale 2026
irinanazarova
0
340
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.5k
JRuby: Past, Present, and Future
headius
0
220
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
130
FreeBSDでZabbixを動かす
kenkino
0
360
残高管理から台帳サービスへの進化
artoy
0
150
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
100
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
190
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
310
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Documentation Writing (for coders)
carmenintech
77
5.6k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Designing Powerful Visuals for Engaging Learning
tmiket
1
590
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Typedesign – Prime Four
hannesfritz
42
3.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
第46回 PostgreSQLアンカンファレンス@東京 Yasuo Honda @yahonda pg_stat_statementsで inの数が違うSQLをまとめて ほしい
• Yasuo Honda @yahonda ◦ Rails committer ◦ 第36回,39回 PostgreSQLアンカンファレンス
から3回目の参加 ▪ 第36回 PostgreSQLアンカンファレンス@オンライン ▪ 第39回 PostgreSQLアンカンファレンス@オンライン - connpass • 遅延可能な制約はRails 7.1からmigrationで作成可能になりました 自己紹介
• IN句の数が違うだけのSQLが異なるSQLとして`pg_stat_statements` に記録される • IN を ANY に書き換えるとANY句の数が違っても単一のSQLとして `pg_stat_statements`に記録されるため、INを全てANYに置き換える pull
requestがRailsに開かれる ◦ https://github.com/rails/rails/pull/49388 • 私はPostgreSQL側で解決して欲しい ◦ https://github.com/rails/rails/pull/49388#issuecomment-1 752253622 背景
• PostgreSQL側でそれを修正するパッチがあることを知る ◦ https://www.postgresql.org/message-id/flat/20230209194 329.z7ectolwilvgppcg%40erthalion.local#be2115b1ac27fedd 45783f57d4e8a6ee • パッチがマージされるためにできることをしたい 背景
• PostgreSQL Conference Japan 2021でこのセッションに出ていた ◦ https://www.slideshare.net/nttdata-tech/postgresql-glob al-development-group-postgresql-conference-japan-2021 -nttdata •
PostgreSQLのmasterブランチをビルドできる環境を持っていた • うっすら覚えていたこと ◦ Issue trackerはなく、メーリングリストで議論が進む ◦ Commitfestという期間でパッチが集中的にレビューされる 知っていたこと
困ったこと
• pgsql-hackersメーリングリストに参加した • 該当スレッドに返信したいが、最新は私の参加前 ◦ https://www.postgresql.org/message-id/flat/CA%2Bq6zc WtUbT_Sxj0V6HY6EZ89uv5wuG5aefpe_9n0Jr3VwntFg%40 mail.gmail.com • どうやってreplyすればいいかわからない
• postgresql-jp Slackで質問 ◦ “Resend email”をおすとそのメールが再送されることを教えてもらう 過去のメーリングリストのメールにreply
• pgsql-hackers • 該当トピックだけ知りたかった • 見逃ししたくなかったので全部メールを受け取っていた • CommitfestのHistoryからこの件だけのメールを受け取っている ◦ https://commitfest.postgresql.org/47/2837
pgsql-hackersメール流量が多い
• C言語、PostgreSQLのコードベースに知見がない ◦ Ruby on Railsからの利用者としてのユースケースしかない • postgresql-jp Slackで質問 ◦
ユースケースを言うだけでも意味があると教えてもらう • 投稿するが、”Moved to next CF”となる ◦ https://www.postgresql.org/message-id/CAKmOUTmDJ_p 9PrEX5vfnS-fz-n8tdYQ6xcApeVrBt5yPkzxgqQ%40mail.gma il.com ◦ https://commitfest.postgresql.org/34/2837/ PostgreSQLのコードベース
• GitHubでのpull requestベースでの開発 ◦ gh pr checkoutなどで、そのcommitがマージされたブランチが手 に入る環境に馴染みがある • .patchファイルの当て方がよくわからない
◦ これは未だに解決していません Patchを当てる方法
知りたいこと、したいこと
• Patchを当てたい ◦ patchコマンドの使い方がよくわからない • PostgreSQL本体にマージされるためにできることをしたい 知りたいこと・したい事
おわり
フォローアップ
• .patchファイルは`git am`で当てられる • Commitfest対象のパッチが最新のmasterブランチとのコンフリクト状 況は”PostgreSQL Patch Tester”でわかる ◦ http://cfbot.cputube.org
◦ リサイクルのようなアイコンはコンフリクトしている ◦ http://cfbot.cputube.org/patch_47_2837.log 教えてもらったこと
• コンフリクトが続くとCommitfestから除外される可能性もあるので、コン フリクトしていることをpgsql-hackersで伝えるのもいい • コンフリクトしないcommit hashを教えてもらってローカルでテストし(私 の観点だと)動作が期待するものではなかったことを返信 ◦ https://www.postgresql.org/message-id/CAKmOUTn74jTQ Ak0u2FUMsGjgrNugLOwkyic2MPkbOJtcQrufeA%40mail.gm
ail.com 教えてもらったこと