I am not sure if this is correct. If you look at Piwik_ArchiveProcessing_Period::computeNbUniqVisitors it says:
"Processes number of unique visitors for the given period
This is the only metric we process from the logs directly,
since unique visitors cannot be summed like other metrics."
And sure enough the query just counts the distinct visitor ids in the log_visit table for a period of time.
Can one of the developers confirm that there is something else going on that keeps monthly unique visitor counts “accurate” when you keep less than 30 days of history?