mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Huawei: improve database performance
This commit is contained in:
+1
-1
@@ -261,7 +261,7 @@ public class HuaweiSampleProvider extends AbstractSampleProvider<HuaweiActivityS
|
|||||||
}
|
}
|
||||||
Property deviceProperty = getDeviceIdentifierSampleProperty();
|
Property deviceProperty = getDeviceIdentifierSampleProperty();
|
||||||
qb.where(deviceProperty.eq(dbDevice.getId()), otherTimestampProperty.ge(timestampFrom))
|
qb.where(deviceProperty.eq(dbDevice.getId()), otherTimestampProperty.ge(timestampFrom))
|
||||||
.where(timestampProperty.le(timestampTo))
|
.where(timestampProperty.le(timestampTo), timestampProperty.ge(timestampFrom - 60*60*24)) // The timestamp.ge is necessary for db performance
|
||||||
.orderAsc(timestampProperty);
|
.orderAsc(timestampProperty);
|
||||||
List<HuaweiActivitySample> samples = qb.build().list();
|
List<HuaweiActivitySample> samples = qb.build().list();
|
||||||
for (HuaweiActivitySample sample : samples) {
|
for (HuaweiActivitySample sample : samples) {
|
||||||
|
|||||||
Reference in New Issue
Block a user