Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 実行に60〜90秒を要しているクエリのチューニング #19

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

yamashush
Copy link
Member

@yamashush yamashush commented Sep 1, 2023

背景

🎫 詳細はチケット https://smarthr.atlassian.net/browse/CPEN-1942

実行に60〜90secかかっているクエリがあって、深刻なパフォーマンス低下を引き起こしているのでチューニングします。
原因は、10^6〜10^7レコードが存在するRevisionテーブルをselectする際にシーケンシャルスキャンになっているため。
where条件的に、noteIdカラムにインデックスを追加すれば解消すると思います。
もし改善しなければ他のチューニング手段を考えます。

stagingでは動作確認して、凪の状態で20〜30秒かかっていたものが1秒未満で完了する状態にはなっています。

image

@yamashush yamashush self-assigned this Sep 1, 2023
Copy link

@shigerix shigerix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:arigatau:

js でこの辺制御してるんすね!

@yamashush yamashush merged commit da7b602 into master-smarthr Sep 1, 2023
@yamashush yamashush changed the title 実行に60〜90秒を要しているクエリのチューニング 🔧 実行に60〜90秒を要しているクエリのチューニング Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants