Counting is inherently slow.
Even more so when you need to read the stuff you
count from disk.
If you need faster disk access I recommend using more
disks and spread them on different SATA buses (if you've SATA disk) and
tell Virtuoso to use stripes.
This way you'll have more Disk I/O
bandwidth and parallelization.