forked from Qortal/qortal
Fix slow SQL query in HSQLDBATRepository.getBlockATStatesAtHeight() - mostly used during orphaning
This commit is contained in:
parent
3ef8b81e51
commit
a310e751bb
@ -374,9 +374,10 @@ public class HSQLDBATRepository implements ATRepository {
|
|||||||
@Override
|
@Override
|
||||||
public List<ATStateData> getBlockATStatesAtHeight(int height) throws DataException {
|
public List<ATStateData> getBlockATStatesAtHeight(int height) throws DataException {
|
||||||
String sql = "SELECT AT_address, state_hash, fees, is_initial "
|
String sql = "SELECT AT_address, state_hash, fees, is_initial "
|
||||||
+ "FROM ATStates "
|
+ "FROM ATs "
|
||||||
+ "LEFT OUTER JOIN ATs USING (AT_address) "
|
+ "LEFT OUTER JOIN ATStates "
|
||||||
+ "WHERE height = ? "
|
+ "ON ATStates.AT_address = ATs.AT_address AND height = ? "
|
||||||
|
+ "WHERE ATStates.AT_address IS NOT NULL "
|
||||||
+ "ORDER BY created_when ASC";
|
+ "ORDER BY created_when ASC";
|
||||||
|
|
||||||
List<ATStateData> atStates = new ArrayList<>();
|
List<ATStateData> atStates = new ArrayList<>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user