Can ReadUncommitted know all LOWER auto-increment IDs that will exist?
问题 Suppose we have a table with an auto-increment primary key. I want to load all IDs greater than the last ID I have seen. SELECT id FROM mytable WHERE id > 10; With the naive approach, I risk skipping IDs: Transaction 1 claims ID 11. Transaction 2 claims ID 12. Transaction 2 commits. I read all IDs >10. I see 12, and next time I will read all IDs >12. I have skipped 11. Transaction 1 commits. For all intents and purposes, ID 11 now exists. As a solution, I propose to do a double check to