# HG changeset patch # User Sascha L. Teichmann # Date 1303142483 0 # Node ID e09634fbf6bc1961ec2b2347763b439bf538e1d9 # Parent 07eba6d3b4a5a0318fa78aa493349a9c0efc8441 Moved the query complexity of creating a w/q value table into view 'wst_value_table' and used this instead. flys-artifacts/trunk@1724 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 07eba6d3b4a5 -r e09634fbf6bc flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Apr 18 14:40:35 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Apr 18 16:01:23 2011 +0000 @@ -1,3 +1,9 @@ +2011-04-18 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java: + Moved the query complexity into view 'wst_value_table' and + used this instead. + 2011-04-18 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java: diff -r 07eba6d3b4a5 -r e09634fbf6bc flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java Mon Apr 18 14:40:35 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java Mon Apr 18 16:01:23 2011 +0000 @@ -26,25 +26,9 @@ // TODO: put this into a property file public static final String SQL_POS_WQ = - "SELECT wcv.position AS position," + - " w," + - " (SELECT q" + - " FROM wst_column_q_ranges wcqr" + - " JOIN wst_q_ranges wqr" + - " ON wcqr.wst_q_range_id = wqr.id" + - " JOIN ranges r" + - " ON r.id = wqr.range_id" + - " WHERE wcqr.wst_column_id = wc.id" + - " AND wcv.position BETWEEN r.a AND r.b) AS q," + - " wc.position AS column_pos " + - "FROM wst_column_values wcv" + - " JOIN wst_columns wc" + - " ON wcv.wst_column_id = wc.id" + - " JOIN wsts w" + - " ON wc.wst_id = w.id " + - "WHERE w.id = :wst_id" + - "ORDER BY wcv.position ASC," + - " wc.position DESC"; + "SELECT position, w, q, column_pos" + + " FROM wst_value_table" + + " WHERE wst_id = :wst_id"; public static class Column implements Serializable