You can use
as_of clause with the following queries:
To retrieve historical data from 5 minutes ago:
await Band.select().where( Band.name == 'Pythonistas' ).as_of('-5min')
This generates an
AS OF SYSTEM TIME clause. See documentation.
This clause accepts a wide variety of time and interval string formats.
This is very useful for performance, as it will reduce transaction contention across a cluster.
Currently only supported on Cockroach Engine.