MariaDB/MySQL compatible fixes and patches. Patch codes
are based on mainly works of Yi EungJun and yobi developers.
Thanks to their efforts, database migration and test was accomplished
easily.
Tested target DB and version
- MariaDB 10.1.10
- MySQM 5.6.28
Problem: When getting watchers only to know whether a specific user is watching
the resource, checking every user, who watches the resource, has the proper
permission to read the resource is not necessary.
Solution: Add a boolean parameter to getWatcher() methods to tell whether
permission check is necessary.
This makes it two times faster, to get an issue with 19 comments, in a project
watched by 344 users.
Do not consider user.loginId. It is not necessary because user.id is enough to
identify the user.
Getting user.loginId may be slow because it may require an additional query to
the database.
This makes it 1.31 times faster, to get an issue with 19 comments, in a project
watched by 344 users.
Put @Transactional annotation to IssueApp#issue() and IssueApp#issues(). It
enables the cache by ORM and improves the performance 2-3 times.
This makes it 6.28 times faster, to get an issue with 19 comments, in a project
watched by 344 users. I am pretty sure that the annotation on IssueApp#issues()
also improves the performance.
Note: We already tried putting @Transactional to the all controllers at
e9d63df, but rollbacked it at 8c25ca9 because of some bugs that some getters of
entities occasionally return null. I guess 13f8014 prevents the bug on IssueApp
so this commit seem to be okay.