there are quite a few database solutions for this problem. SQL itself isn't that great for range queries but there are binning schemes that basically extent the idea of doing the query by chromosome and narrow down the query into a region. Check out Bio::DB::GFF for example. The underlying binning scheme is described in this 2002 paper by Lincoln Stein et al.