more performance improvements with sqlite_db prepared statements and such
final speedup