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

User facing option to optimize database tables #25967

Closed
akhilnarang opened this issue Apr 16, 2024 · 7 comments · Fixed by #26109
Closed

User facing option to optimize database tables #25967

akhilnarang opened this issue Apr 16, 2024 · 7 comments · Fixed by #26109

Comments

@akhilnarang
Copy link
Member

Example: delete rows from Data Import Log - storage doesn't get freed up until you run

OPTIMIZE TABLE `tabData Import Log`;
@ankush
Copy link
Member

ankush commented Apr 16, 2024

database storage report > action > optimize table > select doctype ??

@niraj2477
Copy link
Contributor

We can optimize both MyISAM and InnoDB tables.
https://dev.mysql.com/doc/refman/8.0/en/optimize-table.html

@akhilnarang
Copy link
Member Author

We can optimize both MyISAM and InnoDB tables.

Yep, had pointed out specifically for MyISAM since the need came about because the storage doesn't get freed up.
Will update title to keep it generic.

@akhilnarang akhilnarang changed the title Option to optimize MyISAM tables User facing option to optimize database tables Apr 17, 2024
@niraj2477
Copy link
Contributor

niraj2477 commented Apr 17, 2024

https://www.postgresql.org/docs/current/sql-vacuum.html

We can have something like frappe.db.optimize() maybe to support for both db 🤔

@ankush
Copy link
Member

ankush commented Apr 18, 2024

Btw OPTIMIZE basically rewrites entire table for InnoDB. Optimize call causes a lot of I/O on large tables. People will spam this everywhere without knowing costs of it. It's simple query, doesn't need any special API IMO.

@niraj2477
Copy link
Contributor

niraj2477 commented Apr 18, 2024

rewrites entire table for InnoDB

True. Can be just db.sql in that case, will work on it

@frappe-pr-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 15.25.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants