Use SQLite for cache data save/load.
Fix a database cursor defect.

Also add a cost time util.