Skip to content

Commit

Permalink
ALTER TABLE votes ADD INDEX idx_votes_candidate_id (candidate_id);
Browse files Browse the repository at this point in the history
  • Loading branch information
mickamy committed Jan 2, 2024
1 parent 6510847 commit c23c349
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions note.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,20 @@ docker exec -i ishocon2-bench-1 sh -c "./benchmark --ip app:443 --workload 4"
~/ghq/github.com/mickamy/ISHOCON2 imp1* 1m 30s
```

- ALTER TABLE votes ADD INDEX idx_votes_candidate_id (candidate_id);

```
❯ make bench
docker exec -i ishocon2-bench-1 sh -c "./benchmark --ip app:443 --workload 4"
2024/01/02 01:49:33 Start GET /initialize
2024/01/02 01:49:33 期日前投票を開始します
2024/01/02 01:49:34 期日前投票が終了しました
2024/01/02 01:49:34 投票を開始します Workload: 4
2024/01/02 01:50:20 投票が終了しました
2024/01/02 01:50:20 投票者が結果を確認しています
2024/01/02 01:50:35 投票者の感心がなくなりました
2024/01/02 01:50:35 {"score": 19292, "success": 16996, "failure": 0}
~/ghq/github.com/mickamy/ISHOCON2 imp1* 1m 2s
```
1 change: 1 addition & 0 deletions webapp/ruby/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def voice_of_supporter(candidate_ids)

def db_initialize
db.query('DELETE FROM votes')
db.query('ALTER TABLE votes ADD INDEX idx_votes_candidate_id (candidate_id)')
end
end

Expand Down

0 comments on commit c23c349

Please sign in to comment.