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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yasuo Honda
March 24, 2024
Programming
310
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
360
私のRails開発環境
yahonda
0
250
Railsの話をしよう
yahonda
0
300
RailsのPostgreSQL 18対応
yahonda
0
4k
Contributing to Rails? Start with the Gems You Already Use
yahonda
2
260
PostgreSQL 18 cancel request key長の変更とRailsへの関連
yahonda
0
340
extensionとschema
yahonda
1
370
NOT VALIDな検査制約 / check constraint that is not valid
yahonda
1
320
今、始める、第一歩。 / Your first step
yahonda
3
1.6k
Other Decks in Programming
See All in Programming
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
210
信頼性の目標を誰も求めてない
shubox
0
500
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
230
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
120
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
ALB ログから Trace を気合で繋げる技術
fohte
7
880
新卒PdEのリアル
ryu1013
1
490
Foundry Localでエージェント開発
seosoft
0
170
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
140
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
440
高専キャリア LT 発表内容
crysta1221
6
5.6k
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
340
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Invisible Side of Design
smashingmag
301
52k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
510
The Cult of Friendly URLs
andyhume
79
7k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Ethics towards AI in product and experience design
skipperchong
2
370
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Unsuck your backbone
ammeep
672
58k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
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 教えてもらったこと