Do not create table on 'query', only on 'store' (#11961)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
d45bcdb7aa
commit
346fcd068c
|
@ -193,19 +193,16 @@ public class JdbcPersistenceService extends JdbcMapper implements QueryablePersi
|
|||
|
||||
String table = sqlTables.get(itemName);
|
||||
if (table == null) {
|
||||
logger.warn(
|
||||
"JDBC::query: unable to find table for query, no data in database for item '{}'. Current number of tables in the database: {}",
|
||||
itemName, sqlTables.size());
|
||||
// if enabled, table will be created immediately
|
||||
logger.warn("JDBC::query: try to generate the table for item '{}'", itemName);
|
||||
table = getTable(item);
|
||||
logger.debug("JDBC::query: unable to find table for item with name: '{}', no data in database.", itemName);
|
||||
return List.of();
|
||||
}
|
||||
|
||||
long timerStart = System.currentTimeMillis();
|
||||
List<HistoricItem> items = getHistItemFilterQuery(filter, conf.getNumberDecimalcount(), table, item);
|
||||
|
||||
logger.debug("JDBC::query: query for {} returned {} rows in {} ms", itemName, items.size(),
|
||||
System.currentTimeMillis() - timerStart);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("JDBC: Query for item '{}' returned {} rows in {} ms", itemName, items.size(),
|
||||
System.currentTimeMillis() - timerStart);
|
||||
}
|
||||
|
||||
// Success
|
||||
errCnt = 0;
|
||||
|
|
Loading…
Reference in New Issue