Why does the current system time not insert the record of the current moment, but the record of the previous moment?

Hello,
The sample rate is 5 minutes and the recent record is not current through the sql query:

thank you!

If you read the description of the analog compression algorithm, you’ll see that recording of values lags one sample behind.

https://docs.inductiveautomation.com/display/DOC81/Configuring+Tag+History#ConfiguringTagHistory-DeadbandandAnalogCompression

Side note: don’t query the Tag Historian’s storage directly. Use Ignition’s scripting methods.