Interesting trick to detect table scans with SQLite. I can see that useful in development to optimize systems.