GetTrainRouteの仕様変更・クエリ性能改善・新幹線速度プロファイル修正をmasterへ反映 - #1588
Merged
Conversation
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…1586) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* 経路検索のN+1クエリ解消などクエリ処理のパフォーマンスを改善 - get_routes: 経路候補グループごとに路線を取得していたN+1クエリを 一括取得+line_group_cdパーティションに変更。発着駅を含まない 候補グループは路線取得・proto変換の前に除外する - get_routes: TrainTypeに埋め込むlinesを停車駅ごとに再フィルタ+ cloneせず、グループごとに一度だけ構築する - update_station_vec_with_attributes_inner: ループ末尾で get_station_numbersを同一入力で再計算していた冗長処理を削除 - update_station_vec_with_attributes_inner: 会社IDを一意化してから IN句クエリに渡すようにし、路線数分の重複バインドを解消 - get_routesの一括取得・候補除外・種別路線構築を検証するテストを追加 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * IPAキャッシュをArcで返しヒット時のディープクローンを解消 キャッシュヒットのたびにIpaResult(TTSセグメントのVecを含む)全体を ディープクローンしていたため、リスト系レスポンスでは駅・路線・種別 ごとに数個のStringアロケーションが発生していた。Arc<IpaResult>を 返す形にし、proto変換時に必要なフィールドだけをクローンする。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * 性能インデックスを起動時に明示的に作成し欠落を検知可能にする create_table.sqlのDOブロックは拡張が使えない環境向けに例外を NOTICEで握り潰すため、インデックス作成に失敗しても起動ログからは 分からない。実際に稼働DBでtrigramインデックス5本だけが欠落し、 駅名検索が毎回全表スキャンになる事例があった。 必要な拡張はcreate_schema冒頭で必須として作成済みのため、 性能インデックスはスキーマ適用後に明示的に作成し直し、作成後に pg_indexesを検証して欠落があればERRORログで可視化する。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概要
devに溜まっていたGetTrainRouteまわりの仕様変更・クエリ処理のパフォーマンス改善・新幹線の速度プロファイル修正(#1583〜#1587)をmasterへ反映する。変更の種類
変更内容
GetTrainRoute 関連
GetTrainRouteRequestの駅指定をグループIDから単一IDに変更(protoサブモジュール更新を含む) (GetTrainRouteRequestの駅指定をグループIDから単一IDに変更 #1583)GetTrainRouteのline_group_idをprotoどおりoptional扱いにし未指定時は路線の駅列にフォールバック (GetTrainRouteのline_group_idをprotoどおりoptional扱いにし未指定時は路線の駅列にフォールバック #1586)パフォーマンス・コード品質
到着時間推定(ETA)
テスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること関連Issue
スクリーンショット(任意)