feat(server): optimize get asset query (#7176)

* faster query

* add index

* remove legacy code

* update mock

* remove unused imports

* add relations

* add stack

* formatting

* remove stack relation

* remove unused import

* increase chunk size

* generate sql

* linting

* fix typing

* formatting
This commit is contained in:
Mert 2024-02-18 13:22:25 -05:00 committed by GitHub
parent 8e1c85fe4f
commit 857ec0451d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 111 additions and 45 deletions

View file

@ -63,7 +63,7 @@ class AssetService {
/// Returns `null` if the server state did not change, else list of assets
Future<List<Asset>?> _getRemoteAssets(User user) async {
const int chunkSize = 5000;
const int chunkSize = 10000;
try {
final DateTime now = DateTime.now().toUtc();
final List<Asset> allAssets = [];