Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6d95864
add BufferNeeds utils for calculating best buffer numbers to use
uchijo May 18, 2025
a5a2cea
add chunk_scan.go
uchijo May 18, 2025
0044ab6
move buffer_needs.go due to cyclic import
uchijo May 19, 2025
03fed50
add MultiBufferProduct stuff
uchijo May 19, 2025
11d34a0
Merge branch 'main' of github:team-gonyo/gonyo-db into feature/chapter14
uchijo May 19, 2025
644f129
Merge branch 'main' of github:team-gonyo/gonyo-db into feature/chapter14
uchijo May 31, 2025
0021a4f
change signature of MultiBufferProductPlan
uchijo May 31, 2025
e3fa294
テスト追加&バグ修正
uchijo Jun 4, 2025
9bbe559
feat: クエリオプティマイザー専用ベンチマークフレームワークを追加
kobayashiharuto Jun 5, 2025
1e0b4e2
feat: クエリオプティマイザー専用ベンチマークフレームワークを追加
kobayashiharuto Jun 5, 2025
a61be6f
ci: ベンチマーク用GitHub Actions設定を追加
kobayashiharuto Jun 5, 2025
acb4f73
fix: GitHub ActionsにPRコメント権限を追加
kobayashiharuto Jun 5, 2025
8beaa28
fix: GitHub Actionsの権限設定を詳細化
kobayashiharuto Jun 5, 2025
f23cd75
fix: 存在しないテーブルでのSlice out of bounds エラーを修正
kobayashiharuto Jun 5, 2025
39e623d
fix: GitHub Actions権限とCheckout設定を修正
kobayashiharuto Jun 5, 2025
f348013
feat: PRコメントを廃止してGitHub Actions Summary表示に変更
kobayashiharuto Jun 5, 2025
7e3de8f
feat: 全クエリ結果表示、パフォーマンス改善度削除
kobayashiharuto Jun 5, 2025
e2be9e6
feat: クエリツリー構造可視化テストに全面刷新
kobayashiharuto Jun 5, 2025
d8e38d0
fix: MergeJoinPlan試行を追加、結合条件が正しく結合として処理されるように修正
kobayashiharuto Jun 5, 2025
2583012
feat: ベンチマーク結果にプランツリー全体表示を追加
kobayashiharuto Jun 5, 2025
14a57ed
Refactor: 教科書理論に忠実なHeuristicQueryPlannerとシンプルなベンチマークフレームワークの実装・整理\n\n…
kobayashiharuto Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Query Optimizer Benchmark

on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "plan/**"
- "benchmark/**"
- ".github/workflows/benchmark.yml"

permissions:
contents: read
issues: write
pull-requests: write
actions: read

jobs:
benchmark:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ github.head_ref || github.ref }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23.5"

- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download

- name: Run Query Optimizer Benchmark
env:
CI: true
run: |
echo "🚀 クエリオプティマイザーベンチマーク実行中..."
go test -v ./benchmark -run TestQueryOptimizerBenchmark -timeout 10m | tee benchmark_output.txt
echo "✅ ベンチマーク完了"

- name: Create benchmark summary
if: always()
run: |
echo "📊 ベンチマーク結果解析中..."

# benchmark-results.jsonが存在するかチェック
if [ -f "benchmark-results.json" ]; then
echo "JSON結果ファイルが見つかりました"
echo "BENCHMARK_JSON_EXISTS=true" >> $GITHUB_ENV
else
echo "JSON結果ファイルが見つかりません"
echo "BENCHMARK_JSON_EXISTS=false" >> $GITHUB_ENV
fi

# GitHub Actions Summary に結果を出力
if [ -f "benchmark_output.txt" ]; then
echo "## 📈 クエリオプティマイザー ベンチマーク結果" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# 成功率抽出
SUCCESS_RATE=$(grep -o "実行成功率: [0-9/]* ([0-9.]*%)" benchmark_output.txt || echo "成功率情報なし")
if [ "$SUCCESS_RATE" != "成功率情報なし" ]; then
echo "✅ **$SUCCESS_RATE**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
fi

# 詳細なテーブル結果を抽出(全クエリ)
echo "### 📋 詳細結果" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
sed -n '/📋Query/,/📈全体統計/p' benchmark_output.txt | head -n -2 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

echo "### 📊 ダウンロード" >> $GITHUB_STEP_SUMMARY
echo "完全な結果はArtifacts からダウンロードできます" >> $GITHUB_STEP_SUMMARY

# ファイルにも保存(Artifact用)
cp $GITHUB_STEP_SUMMARY benchmark_summary.md 2>/dev/null || echo "Summary copy failed"

echo "Generated benchmark summary for Actions"
else
echo "❌ ベンチマーク出力ファイルが見つかりません" >> $GITHUB_STEP_SUMMARY
fi

- name: Upload benchmark results
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
benchmark_output.txt
benchmark-results.json
benchmark_summary.md
retention-days: 30
4 changes: 2 additions & 2 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: setup
uses: actions/setup-go@v5
with:
go-version: '1.23.5'
go-version: "1.23.5"

- name: cache
uses: actions/cache@v4
Expand All @@ -27,4 +27,4 @@ jobs:
run: go mod download

- name: test
run: go test -v ./...
run: go test -v $(go list ./... | grep -v '/benchmark')
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Test database directories
test_dbs/
*.db

# Go build artifacts
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# IDE files
.vscode/
.idea/
*.swp
*.swo

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

*.txt

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

# Benchmark results
benchmark-results.json
benchmark_output.txt
benchmark_summary.md
Loading
Loading