Skip to content

fix(event): new indexes based on status#2468

Open
ArtificialOwl wants to merge 1 commit intomasterfrom
fix/noid/index-on-event-status
Open

fix(event): new indexes based on status#2468
ArtificialOwl wants to merge 1 commit intomasterfrom
fix/noid/index-on-event-status

Conversation

@ArtificialOwl
Copy link
Copy Markdown
Member

@ArtificialOwl ArtificialOwl commented Apr 28, 2026

adding an index on status and creation to lighten some request, mainly when cleaning the table:

public function deleteOldEntries(bool $allOldEntries = false): void {
$qb = $this->getEventWrapperDeleteSql();
$qb->where(
$qb->exprLimitInt('status', EventWrapper::STATUS_OVER),
$qb->exprLt('creation', time() - 30 * 86400)
);
if (!$allOldEntries) {
$qb->andWhere($qb->exprLimitInt('status', EventWrapper::STATUS_OVER));
}
$qb->executeStatement();
}

In some edgy use case, the table might be too big for the purge to be fulfill, cascading with an ever growing database

note: backport will require an upgrade of the version

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl
Copy link
Copy Markdown
Member Author

/backport to stable33

@ArtificialOwl
Copy link
Copy Markdown
Member Author

/backport to stable32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant