Skip to content

Conversation

@Syogo-Suganoya
Copy link
Contributor

@Syogo-Suganoya Syogo-Suganoya commented Jan 26, 2025

概要

テストで no_fullscan を使用しましたが、フルスキャンが行われている際も、正解判定がされます。

@Syogo-Suganoya Syogo-Suganoya self-assigned this Jan 26, 2025
@Syogo-Suganoya Syogo-Suganoya linked an issue Jan 26, 2025 that may be closed by this pull request
Copy link
Contributor Author

@Syogo-Suganoya Syogo-Suganoya left a comment

Choose a reason for hiding this comment

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

@a-miyashita review me

function fullscan(records, tables, every) {
const re = new RegExp(
`^SCAN TABLE (${(tables || []).join('|') || '\\w+'})`
`^SCAN(?: TABLE)? (${(tables || []).join('|') || '\\w+'})`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SCAN {テーブル名}でもSCAN TABLE{テーブル名}でも検知するようにしました。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

理由

SCAN TABLE {テーブル名}ではなく、SCAN {テーブル名}のフォーマットで出力されます。

EXPLAIN QUERY PLANの結果

不正解時

id parent notused detail
2 0 0 SCAN sports

正解時

id parent notused detail
3 0 0 SEARCH sports USING INDEX sports_name_idx (name=?)

確認可能なコンテンツ

スポーツ検索システムのデータベース構築をせよ SQL編 で確認可能です。
TCM
https://new.tracks.dev/app/01GGP9MCKKDADZ4HQATZG3FXM3/materials?statuses=2&shipStatuses=shipped&keyword=sql-design-sport&selectedId=2-4990

Copy link
Contributor Author

Choose a reason for hiding this comment

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

備考

SCAN {テーブル名}になる原因も調査してみましたが、別名テーブルサブクエリを使用しているとなるようです。
しかし、そのような箇所はないはずなので、原因としては不明なままです。

@Syogo-Suganoya Syogo-Suganoya merged commit 5185c3d into main Jan 27, 2025
7 checks passed
@Syogo-Suganoya Syogo-Suganoya deleted the fix/#51 branch January 27, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no_fullscanの判定が効かない

3 participants