feat 管理画面(受注一覧・商品一覧)、フロント画面(商品一覧)のN+1問題対応 #3581
Merged
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.
概要(Overview・Refs Issue)
管理画面 受注一覧・商品一覧、フロント画面の商品一覧のN+1問題対応
ローカルでの検証結果は以下
変更前
Query time717.86 ms
Query time6691.96 ms
Query time104.97 ms
Query time1001.84 ms
Query time17.15 ms
Query time33.14 ms
Query time375.17 ms
Query time1244.07 ms
※フロント画面:商品一覧の1000件はエラーで表示できなかったので200件でテスト
改善後
Query time86.96 ms
Query time369.28 ms
Query time57.33 ms
Query time251.93 ms
Query time349.10 ms
Query time1231.53 ms
方針(Policy)
明示的にjoinする。
実装に関する補足(Appendix)
テスト(Test)
なし
相談(Discussion)
フロント画面:商品一覧についていい方法があれば教えてください。