Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
pg_stat_statementsで inの数が違うSQLをまとめて ほしい
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yasuo Honda
March 24, 2024
Programming
0
290
pg_stat_statementsで inの数が違うSQLをまとめて ほしい
第46回 PostgreSQLアンカンファレンス@東京
Yasuo Honda
March 24, 2024
Tweet
Share
More Decks by Yasuo Honda
See All by Yasuo Honda
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
0
120
私のRails開発環境
yahonda
0
220
Railsの話をしよう
yahonda
0
250
RailsのPostgreSQL 18対応
yahonda
0
3.1k
Contributing to Rails? Start with the Gems You Already Use
yahonda
2
220
PostgreSQL 18 cancel request key長の変更とRailsへの関連
yahonda
0
280
extensionとschema
yahonda
1
340
NOT VALIDな検査制約 / check constraint that is not valid
yahonda
1
260
今、始める、第一歩。 / Your first step
yahonda
3
1.4k
Other Decks in Programming
See All in Programming
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
610
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
3.1k
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
390
KagglerがMixSeekを触ってみた
morim
0
260
Java 21/25 Virtual Threads 소개
debop
0
270
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
330
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.3k
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
790
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
180
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
380
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
240
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
490
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
140
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
Into the Great Unknown - MozCon
thekraken
40
2.3k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
480
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
860
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
130
Designing Experiences People Love
moore
143
24k
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 教えてもらったこと