Danger, Will Robinson! Indiscriminately removing data based on the sheer data size alone WILL lead to subtle and sometimes tragic problems with the operation of your site. I can think of quite a few reasons why such a feature would function with as much grace as a sledgehammer given to a meth head. My top reasons are:
- Items with ACL privileges. It's impossible to know which record in the #__assets table is linked to that record you so conveniently zapped. End result: broken permissions and all Hell breaks loose.
- Items with tags, content versioning or otherwise using the Joomla! UCM. Same as above but with half a dozen different tables.
- Related records. Let's have a simple example. You have books, chapters and articles. For some reason the chapters table gets too long and in a fit of fury you decide to delete it. Now your articles are orphan. At best, the articles table has just gotten a lot of unnecessary baggage. Usually it's the worst case scenario: the extension will crap its pants and cry for its daddy to pick it up.
- Removing important business data / data required by regulatory authorities. Invoices, transaction records, audit records etc. What do they all have in common? They are lots of data and if you delete them you are looking at a big fine or jail time.
Basically no. I won't implement that. If you ever see me implementing such a feature please call the authorities and have them check me in to an asylum as soon as possible.
I know what is your use case. You have a lot of extensions writing log data to the database and not giving you an option to keep their size in check. Ask their developers to offer you an option to purge this data. When we had a similar request for Admin Tools' WAF Exceptions log we implemented it; not a big deal.
The reason to ask the developer is that the developer of each extension and the developer alone knows how to PROPERLY delete data with enough safeguards and the necessary code to assure data integrity and prevent major issues with the operation of your site. You should never, EVER delete data by hand unless You Know What You Are Doing™. Chances are that if you didn't write the extension yourself you don't really know what you're doing and there's a good chance you're unwittingly planting a time bomb in your site. Log data are
usually safe to delete unconditionally but anything else usually
isn't.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!