Q:

How can I get a count of all documents in all site collections?

And if I need to make the same count but with some field filters?
Is the best approach populate a list using SPSiteDataQuery and then make the report from that  same list?
spregards

A:

If you're talking about using the Object Model, then I'd recommend SPSiteDataQuery.
It has many options for filtering the results, including by list template (e.g. document library).

