Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deflate and inflate of panel content, changed gc chance from 1% t… #1022

Merged
merged 4 commits into from
Aug 29, 2024

Conversation

Harfusha
Copy link

…o 10%, added 10% chance to vacuum when sqlite is used, added pragma commands for optimalization when using sqlite

#1021

…o 10%, added 10% chance to vacuum when sqlite is used, added pragma commands for optimalization when using sqlite
@markstory markstory added this to the 5.next milestone Aug 22, 2024
src/Model/Entity/Panel.php Outdated Show resolved Hide resolved
src/Model/Entity/Panel.php Outdated Show resolved Hide resolved
Comment on lines -134 to +151
$conn->execute('VACUUM;');
$conn->execute('
PRAGMA auto_vacuum = FULL;
PRAGMA journal_mode = OFF;
PRAGMA synchronous = OFF;
PRAGMA foreign_keys = OFF;
PRAGMA temp_store = MEMORY;
PRAGMA automatic_index = OFF;
');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only happen if the GC is going to occur?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not needed to run everytime, so it is run when gc is ran

PRAGMA automatic_index = OFF;
');

if (!$this->shouldGcVacuum()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we've already passed the rand to do a GC why do we need another rand to do vacuum?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So rows are cleared more frequently, but the slow vacuum should be ran only 1% of requests (I made the check to own functions for static analysis tools and if we want to tweak the chance)

@Harfusha
Copy link
Author

Any other issues with this?

@markstory markstory merged commit acfbc05 into cakephp:5.next Aug 29, 2024
7 checks passed
markstory added a commit that referenced this pull request Aug 29, 2024
We can't rely on this file being used. Instead we can log errors and let
the application developer take care of removing their database file.

Refs #1022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants