Log_hsr_blob - 50g size

Hello all,
I am new with piwik.
what is in this table, and how to shrink it? will I will lose data?

Thanks

There are entries stored from session recordings. The table usually shouldn’t be that big since each stored entry is reused when possible. Maybe your HTML has some HTML attributes or some content that varies for each user?

The storage it uses is usually more in the MB area, not GB.

You could delete some recordings and it should be cleaned up within a month at the latest. You can also force to delete it immediately using
./console core:run-scheduled-tasks "Piwik\Plugins\HeatmapSessionRecording\Tasks.removeDeletedHsrBlobs"
or ./console core:run-scheduled-tasks --force "Piwik\Plugins\HeatmapSessionRecording\Tasks.removeDeletedHsrBlobs" (haven’t tested the command but should be the right now)

Having a similar problem with the Sessions Recordings in that the log_hsr_blob and log_hsr_event tables are more than 1.2GB and 250MB respectively.

I’ve tried running the various tasks suggested (removeDeletedHsrBlobs doesn’t exist):

Piwik\Plugins\HeatmapSessionRecording\Tasks.removeDeletedRecordings
Piwik\Plugins\HeatmapSessionRecording\Tasks.removeUnusedHsrBlobs

… to no avail (including when I try with the --force flag). All the sessions and heatsink maps have been deleted in the UI so I suspect these are orphaned in some way or I’m missing something.

Is there an updated command or some way to clean these tables out so I can recover that data?

Thanks in advance.

EDIT: Just to note that after a lot more messing around trying to identity the issue I eventually deactivated and uninstalled the Heatsink plugin which wiped the two tables and then reinstalled and reactivated… And it’s all gone so a bit drastic but thought I’d update.

2 Likes

Hi @websnail a size of 1.2gb and 250mb is not that big for the types of tables that they are, so in this case its expected to be a potentially big table.

Just to highlight what your colleague stated earlier. Who’s correct?

Regardless of that point I think you missed the fact that I could not clear the tables at all. Any and all attempts to delete the session and/or heatmap data just left the data sitting there doing nothing. Surely that’s not expected behaviour?

Just wanted to update on this as I’ve done some testing since I cleared out and reinstalled the plugin. The plugin is now recording new sessions and heatmap data but the previous problem tables don’t appear to be used by the plugin anymore which is probably why they were never cleaned up.

For anyone else who hits this problems where you find there are:
foo_log_hsr_blob
foo_log_hsr_event
… tables still in your database. Chances are they are legacy tables that the Heatmap and Session recording plugin are no longer using.

You may be able to drop those tables but it would be useful if someone from the dev team who know the Heatmap & session recording plugin, could actually confirm if this is accurate or not.

2 Likes

@V.K, @thomas_matomo , is it accurate?