Database query using select provide erratic results

Hi,

I have issues with the erratic behavior of select statements were the result of a first request will return nothing. But if I run the same statement immediately the database return the correct result.

Here is an example of an select statement that I use:

SELECT avg("active.sessions") AS result
FROM "snmp-*"
WHERE "@timestamp" >= now() - INTERVAL 5 minutes
AND hostname = 'my-host'
AND collector = 'col-01'
HAVING result BETWEEN 1000 AND 5000

If the system has been sitting idle for a couple of minutes I will receive a nothing but if I re-run the select statement immediately the I get the right answer.

Any body have an idea of what is wrong!

Thanks