-
Notifications
You must be signed in to change notification settings - Fork 0
perf(ui): V2メディア一覧の初期表示を高速化 #655
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f7d9cb0
perf(ui): improve v2 media grid loading
hmjn023 375b951
fix(ui): keep virtualized media thumbnails visible
hmjn023 df10483
fix(v2): defer search grid initialization
hmjn023 190f0ba
perf(media): reuse cached grid results
hmjn023 61b31bf
perf(v2): mature media loading UX
hmjn023 a56cffe
test(ui): cover large virtual media grids
hmjn023 576599d
perf(v2): prefetch media in scroll direction
hmjn023 b9adc00
perf(thumbnails): add responsive derivatives and warmup jobs
hmjn023 51d607d
perf(ui): optimize virtual media grid loading
hmjn023 3f6acac
test(perf): cover large gallery scrolling and thumbnail selection
hmjn023 07a1485
perf(ui): start pagination prefetch earlier
hmjn023 e928f2a
fix(review): address thumbnail and event review findings
hmjn023 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| DO $$ | ||
| BEGIN | ||
| DELETE FROM "jobs" AS duplicate | ||
| USING "jobs" AS retained | ||
| WHERE duplicate."type" = 'generate_thumbnail' | ||
| AND duplicate."status" IN ('pending', 'in_progress') | ||
| AND retained."type" = duplicate."type" | ||
| AND retained."status" IN ('pending', 'in_progress') | ||
| AND retained."source_id" = duplicate."source_id" | ||
| AND retained."payload"->>'mediaId' = duplicate."payload"->>'mediaId' | ||
| AND retained."payload"->>'size' = duplicate."payload"->>'size' | ||
| AND (retained."created_at", retained."id") < (duplicate."created_at", duplicate."id"); | ||
|
|
||
| CREATE UNIQUE INDEX "uq_jobs_active_thumbnail" ON "jobs" USING btree ("source_id",("payload"->>'mediaId'),("payload"->>'size')) WHERE "jobs"."type" = 'generate_thumbnail' | ||
| AND "jobs"."status" IN ('pending', 'in_progress') | ||
| AND "jobs"."source_id" IS NOT NULL; | ||
| END $$; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
in_progressのジョブを物理削除します。DELETE の条件は
pendingとin_progressの両方を対象にします。マイグレーション実行時にワーカーが稼働していると、実行中ジョブの行が消えます。その場合、ワーカーの完了更新は0行更新になり、結果とエラーが記録されません。対策は2つあります。削除対象を
pendingのみに限定し、in_progressの重複は自然消滅を待つ方法が安全です。あるいは、マイグレーションをワーカー停止中に実行する運用手順を明記してください。🛠️ pending のみを削除対象にする例
この変更では、
in_progress行が残り、pending側が削除されます。順序比較の条件は再検討が必要です。📝 Committable suggestion
🤖 Prompt for AI Agents