Skip to content

Commit 2fa8838

Browse files
mmerdesrtroilo
authored andcommitted
#470: remove redundant join and cleanup whitespace in sql
1 parent 8842476 commit 2fa8838

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/tagtranslator/JdbcTagTranslator.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ public class JdbcTagTranslator implements TagTranslator {
2929

3030

3131
private static final String OSHDB_OSM_KEY = String.format("SELECT txt, id"
32-
+ " from %s "
32+
+ " from %s"
3333
+ " where id = any(?)", TableNames.E_KEY);
3434

35-
private static final String OSHDB_OSM_TAG = String.format("SELECT kv.txt, valueid"
36-
+ " from %s k"
37-
+ " left join %s kv on k.id = kv.keyid"
38-
+ " where k.id = ? and kv.valueid = any (?)", TableNames.E_KEY, TableNames.E_KEYVALUE);
35+
private static final String OSHDB_OSM_TAG = String.format("SELECT txt, valueid"
36+
+ " from %s"
37+
+ " where keyid = ? and valueid = any (?)", TableNames.E_KEYVALUE);
3938

4039
private static final String OSM_OSHDB_ROLE = String.format("SELECT id, txt"
41-
+ " from %s "
40+
+ " from %s"
4241
+ " where txt = any (?)", TableNames.E_ROLE);
4342

4443
private static final String OSHDB_OSM_ROLE = String.format("SELECT txt, id"
45-
+ " from %s "
44+
+ " from %s"
4645
+ " where id = any (?)", TableNames.E_ROLE);
4746

4847
private final DataSource source;

0 commit comments

Comments
 (0)