mekevans / forestTIME

1 stars 0 forks source link

Speed up queries #23

Closed diazrenata closed 3 weeks ago

diazrenata commented 8 months ago

The queries are now slow on my computer because I have all 50 states worth of data downloaded. They're not prohibitively slow (3 minute-ish for some), but it's not ideal.

This could be sped up considerably by detecting if STATECD is one of the condition variables, and, if so, only connecting to data for the desired states. That way, if you want to get "trees on national forests in Arizona", you connect to the Arizona data and then filter on OWNCD (rather than connecting to all the data and then filtering on STATECD and OWNCD).

In principle you could further refine this to COUNTY, but I think the gains would be negligible