An efficient approach for continuous density queries