79663058

Date: 2025-06-12 07:07:55
Score: 1
Natty:
Report link

I have reason to believe that this strange behaviour resulted from a broken or otherwise incorrect index because luckily OPTIMIZE TABLE did the trick.

Additionally, since we're dealing with system versioned tables, I needed to change the 'alter history' vairable:

SET @@system_versioning_alter_history = KEEP;

output of optimize before setting alter history

After that SELECT [....] gave the same result as SELECT [...] FOR SYSTEM_TIME AS OF NOW() while SELECT [...] FOR SYSTEM_TIME ALL still contained the historical data.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: LukasKroess