Store last elements in a dedicated table
It is likely that you would partition the table by time or region, etc.  Also this is what indexes or caching already do.

So your idea could be appropriate but you need to think about whether you are reinventing the wheel or if your use case can really benefit.