matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.74k stars 2.63k forks source link

Fix console command parameters documentation for optimizing the database #19851

Open heurteph-ei opened 1 year ago

heurteph-ei commented 1 year ago

Documentation URL

https://matomo.org/faq/on-premise/managing-your-databases-size/#purging-and-optimizing-the-database-using-a-console-command

Citation

To reduce execution time, you can select specific date periods to run these scripts for. This means that you can target just the recent > months, for which report data is likely to have changed. Note that data for annual reports is stored in the archives for January of the > appropriate year, so it is a good idea to optimize these regularly as well, e.g.

./console database:optimize-archive-tables last2
./console database:optimize-archive-tables january

We recommend to set up above two commands as a cronjob and have them executed once monthly.

Problem

(Last 2 what? Days, weeks, months, years? Which January? Why only 2 examples? etc.)

But after some trial & error, I figured out at least some of the format:

./console database:optimize-archive-tables 2020
./console database:optimize-archive-tables january-2020
./console database:optimize-archive-tables october-2022

Still a little confusing, because everything else in Matomo uses the YYYY-MM-DD (or at least YYYY-MM) format, but at least it’s something! Not sure why they did it that way, it might be that the tool is only supposed to be used for months or something, not sure.

Source

https://forum.matomo.org/t/what-is-the-best-way-to-purge-old-data-if-it-has-never-been-run-in-12-years/38721

More

Maybe the date format could also be consistent on the whole Matomo API/functions (then another technical issue should be created, I let Matomo team decide...)

MatomoForumNotifications commented 1 year ago

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/what-is-the-best-way-to-purge-old-data-if-it-has-never-been-run-in-12-years/38721/3

sgiehl commented 1 year ago

@justinvelluppillai how shall we handle such documentation related issues? Shall we directly have a look at those and fix it if possible, or maybe forward them to support/website team, so they can have a look? Putting them into prioritization queue doesn't sound useful though.

justinvelluppillai commented 1 year ago

@sgiehl if it's simple enough to add examples or otherwise fix then you can provide improvements directly otherwise they would go through normal prioritisation via the backlog.

matomoto commented 5 months ago

Important question about this documentation page (linked in topic): https://matomo.org/faq/on-premise/managing-your-databases-size/#purging-and-optimizing-the-database-using-a-console-command

This documentation page is also the (only) documentation about purge-old-archive-data (./console core:purge-old-archive-data all). The missing information about this command is: Touch this command the log/raw data? Include this command the setting of delete_logs_enable in the global.ini.php? This infos are important needed in the documentation (and here as an answer).