Replace LEFT JOIN on sources/games with a JOIN

Each master index now has at least one source.

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 years ago
parent 4ad9b31aae
commit 9bce5cc1b3
  1. 8
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt

@ -88,8 +88,8 @@ public class CacheExporter @Inject constructor(
ms.valid_keys,
ms.keys
FROM master_indexes m
LEFT JOIN sources s ON s.master_index_id = m.id
LEFT JOIN games g ON g.id = s.game_id
JOIN sources s ON s.master_index_id = m.id
JOIN games g ON g.id = s.game_id
LEFT JOIN master_index_stats ms ON s.master_index_id = m.id
GROUP BY m.id, g.name, ms.valid_indexes, ms.indexes, ms.valid_groups, ms.groups, ms.valid_keys, ms.keys
ORDER BY g.name ASC, MIN(s.build) ASC, MIN(s.timestamp) ASC
@ -153,8 +153,8 @@ public class CacheExporter @Inject constructor(
ms.valid_keys,
ms.keys
FROM master_indexes m
LEFT JOIN sources s ON s.master_index_id = m.id
LEFT JOIN games g ON g.id = s.game_id
JOIN sources s ON s.master_index_id = m.id
JOIN games g ON g.id = s.game_id
LEFT JOIN master_index_stats ms ON s.master_index_id = m.id
WHERE m.id = ?
GROUP BY m.id, ms.valid_indexes, ms.indexes, ms.valid_groups, ms.groups, ms.valid_keys, ms.keys

Loading…
Cancel
Save