Original User: vangelo
This is pretty easy, but there are some caveats, which make it a bit trickier.
First off, you can create a view that uses a date function so that data is restricted to
7/14/... days from either "today" (midnight last night) or "now" (current time), or
"tomorrow" (midnight tonight).
The problem is, realtime data like this tends to be spatially fragmented. If your import
process fixes the spatial fragmentation, then it will make it temporally fragmented,
which will impact the temporal view performance.
I've built systems to straddle these problems by using partitions and spatially defragmenting
within time windows, so that an "ORDER BY utmzone,latitude" is added to a "WHERE date_col
BETWEEN {lastSunday} AND {thisSunday}" export, then the data table is swapped with the
partition. This leaves the table with a series of week-long chunks of defragmented data.
If the app uses multiple time windows (days and months), you may want to construct parallel
tables with different partition ranges optimized for spatial search (or both temporal *and*
spatial search - disk is cheap, right?).
- V