Skip to content

GetTrainRouteの仕様変更・クエリ性能改善・新幹線速度プロファイル修正をmasterへ反映 - #1588

Merged
TinyKitten merged 5 commits into
masterfrom
dev
Jul 4, 2026
Merged

GetTrainRouteの仕様変更・クエリ性能改善・新幹線速度プロファイル修正をmasterへ反映#1588
TinyKitten merged 5 commits into
masterfrom
dev

Conversation

@TinyKitten

Copy link
Copy Markdown
Member

概要

dev に溜まっていた GetTrainRoute まわりの仕様変更・クエリ処理のパフォーマンス改善・新幹線の速度プロファイル修正(#1583#1587)を master へ反映する。

変更の種類

  • バグ修正
  • 新機能
  • データの修正・追加
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

GetTrainRoute 関連

パフォーマンス・コード品質

到着時間推定(ETA)

テスト

  • cargo fmt --all -- --check が通ること
  • cargo clippy -- -D warnings が通ること
  • cargo testSQLX_OFFLINE=true)が通ること

関連Issue

スクリーンショット(任意)

TinyKitten and others added 5 commits July 4, 2026 03:08
Co-authored-by: Claude Sonnet 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>
@TinyKitten TinyKitten self-assigned this Jul 4, 2026
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 237589d6-a0d6-4ae4-983a-7a7008c23e62

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Comment @coderabbitai help to get the list of available commands.

@TinyKitten
TinyKitten merged commit 06f02ee into master Jul 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant