remove useless join

This commit is contained in:
Mauricio Amione 2023-01-02 05:54:51 -06:00
parent 83ff1f7806
commit 896b468408
8 changed files with 25888 additions and 4544 deletions

5
.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

12
.idea/LeagueStats.iml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/LeagueStats.iml" filepath="$PROJECT_DIR$/.idea/LeagueStats.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

21484
client/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -11,9 +11,6 @@ export interface SelectFilters {
class MatchRepository {
private readonly JOIN_MATCHES = 'INNER JOIN matches ON matches.id = match_players.match_id'
private readonly JOIN_TEAMS =
'INNER JOIN match_teams ON match_players.match_id = match_teams.match_id AND match_players.team = match_teams.color'
private readonly JOIN_ALL = `${this.JOIN_MATCHES} ${this.JOIN_TEAMS}`
private globalFilters(filters: SelectFilters) {
let query = `
@ -229,7 +226,7 @@ class MatchRepository {
SUM(match_players.loss) as losses
FROM
match_players
${this.JOIN_ALL}
${this.JOIN_MATCHES}
INNER JOIN match_players as mates ON match_players.match_id = mates.match_id AND match_players.team = mates.team
WHERE
${this.globalFilters(filters)}
@ -314,7 +311,7 @@ class MatchRepository {
const query =
`
WITH base as (
SELECT
SELECT
${fields.join()},
match_players.win as result,
matches.id,

8904
server/package-lock.json generated

File diff suppressed because it is too large Load diff