Closed wem closed 1 month ago
Hi @wem, we appreciate your interest in hawkBit, your investigation, and your proposal. At this very moment, we are attempting to optimize the Rollout execution - we have similar problems with MySQL. So, we would evaluate carefully your proposal.
MySQL creates such indexes implicitly and this seems reasonable. So, it seems like something that should be added explicitly for Postgres. You could make a PR with these indexes or we could do that if you like.
@wem, we have prepared PR with the indexes - would you like to check if they improve performance in your use case as expected?
I've merged the PR with the proposed indexes - seems fine.
We at Gardena have started evaluating Hawkbit. In our case, we currently have around 300k+ targets. The new feature, "dynamic rollouts," sounds interesting, so we tried it.
After defining some dynamic rollouts, we noted that Hawkbit starts to execute a scheduled (periodic), expensive, and slow query (30min max. duration):
The query plan explanation looks like this:
After a short investigation, we'd propose to add the following indexes to defuse the situation:
After adding those indexes, the query plan looks much more efficient:
We mainly tested it with Postgres 15.4. Postgres 16.2 brought some query planner improvements, which positively affects that query (without additional indexes), but the end result looks similar.
Please note that Postgres doesn't automatically create an index on foreign key constraints!
Kind regards