proxmox-backup/src
Dominik Csapak d90d7ff230 api: admin: datastore: optimize groups api call
Currently we always touch all files for each snapshot in a group when
listing them, even though we don't need all that info.

We're only interested in getting either the last finished snapshot
information, or the last unfinished one (which must the only one in
normal use, we can't have multiple unfinished snapshots usually)

Instead of getting all the information upfront, use the snapshot
iterator of the group to get only the id, sort them by time, and
use the first we're interested in, getting the snapshot specific info
only for those we want to check.

In my (admittedly extreme) setup with ~600 groups with ~1000 snapshots
each, this changes the time this api call needs from ~40s to <1s on a
relatively fast disk.

While at it, lift the restriction of only returning groups with
snapshots in them, now returning also empty ones.

To keep api compatibility, use a timestamp of 0 for those, as no valid
backup could have been made at that time anyway.

This API call is currently used by the web UI to add the group notes
to the backup snapshot tree in the datastore content view, so while it
will help in a few cases, it will not make the listing of all
snapshots itself faster.

(cherry picked from commit e59d33f4ce)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20251008134344.3512958-7-d.csapak@proxmox.com
 [TL: add context for where the UI uses this API call]
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Link: https://lore.proxmox.com/20251027103123.101013-4-c.ebner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-27 17:33:30 +01:00
..
acme hyper: start preparing upgrade to 1.x 2025-03-13 13:23:48 +01:00
api2 api: admin: datastore: optimize groups api call 2025-10-27 17:33:30 +01:00
backup fix #3935: datastore/api/backup: move datastore locking to '/run' 2025-03-26 16:21:43 +01:00
bin pbs3to4: bootloader: only allow systemd-boot before upgrade when used 2025-08-22 15:41:33 +02:00
config restrict consent-banner text length 2025-04-10 11:40:51 +02:00
server sync: switch reader back to a shared lock 2025-04-16 11:35:27 +02:00
tape tape: introduce a tape backup job worker thread option 2025-04-02 16:45:14 +02:00
tools clippy/fmt: tree wide drop of clone for types implementing copy 2025-03-20 14:48:31 +01:00
auth_helpers.rs auth: use auth-api when generating keys and generate ec keys 2024-05-22 16:04:21 +02:00
auth.rs auth: doc: Explicitly set namespace for UserInfomation 2024-12-04 14:40:42 +01:00
client_helpers.rs provide separate helpers for pub/priv auth keyring access 2023-03-29 14:37:45 +02:00
lib.rs metric collection: move rrd_cache to new metric_collection module 2024-10-15 14:09:41 +02:00
traffic_control_cache.rs backup: remove lazy_static dependency 2024-08-14 12:08:01 +02:00