@quba opened this issue on September 30th 2014

Users calculated using UserID feature are currently calculated same as unique visitors in Piwik. That means, that the same setting is applied as for unique visitors (also period to calculate). Piwik user that does not use UserID feature and wants to have unique visitors yearly report, has to execute very heavy SQL query for the year period even though he only wants to calculate unique visitors (distinct idvisitor and distinct user_id).

Proposed solution: 1) Allow to set unique users (based on UserID) processing same as for unique visitors (day, week, month or even a year). 2) Disable unique users processing by default and allow to enable it in config.

Why is it important? I think that the goal is improve Piwik's performance when default configuration is used. This feature may cause performance issues for users that are processing yearly unique visitors even though they are not using UserID feature.

@mattab commented on September 30th 2014

That means, that the same setting is applied as for unique visitors (also period to calculate).

Yes

Piwik user that does not use UserID feature and wants to have unique visitors yearly report, has to execute very heavy SQL query for the year period even though he only wants to calculate unique visitors

Actually nb_users and nb_uniq_visitors are processed in the same SQL query so there is no real performance hit of processing nb_users. Closing as worksforme but let me know if im missing something

Reference code: https://github.com/piwik/piwik/blob/master/core/ArchiveProcessor.php#L395-396

This issue was closed on September 30th 2014
Powered by GitHub Issue Mirror