SELECT ApexPageId,DailyPageViewCount,Id,MetricsDate
FROM VisualforceAccessMetrics
That query will return stats from the latest 90 days
Pageviews are tallied the day after the page is viewed, and each VisualforceAccessMetrics object is removed after 90 days.
To fix that, let’s tweak the query to:
SELECT Id, Markup, Name, NamespacePrefix
FROM ApexPage
WHERE Id IN (SELECT ApexPageId FROM VisualforceAccessMetrics)
Now the query will return only existing pages.