When a Piwik has thousands of segments created, a clear bottleneck is that processing unique visitors and unique users for a period such as week, month, year is very slow. The query to process unique visitors over a week often lasts more than 20 minutes. This is problematic when there are thousands such queries running every day. ## Proposal
As a solution, we could add a new setting
enable_processing_unique_visitors_segments which, when set to 0, would disable unique visitors processing for segments.
We may also want to create more specific settings to disable processing of unique for segments, for a particular period:
enable_processing_unique_visitors_segments_day enable_processing_unique_visitors_segments_week enable_processing_unique_visitors_segments_month enable_processing_unique_visitors_segments_year
Please let's either add
enable_processing_unique_visitors_segments or the others but not both. There's already enough complexity added through all those config settings so we don't have to make it even more complex and harder to understand.