How to get unique number of visitor across a date range?

We want number of unique visitors for a website for given date range. I know that it is a know limitation for performance from Piwik ( Do one have to run query against piwik_log_visit to get this number or is there a more efficient way?

You can enable this feature with a config setting see: How do I enable "Unique Visitors" metric for Yearly reports and for Custom Date Ranges? - Analytics Platform - Matomo