SQLite Forum

Runtime of and opcode counts of ANALYZE
Login
This is a callback function that is called by SQLite (!) while doing the ANALYZE operation.

The callback I've created for this test just increments a counter variable.
SQLite calls the callback 28,000 times for database A. And for the database B with the problem 971,855,609,341 times! The databases are about the same size and with the same schema.

My customer reports that he let it run over night, without ANALYZE ever coming to an end. For this particular database, the runtime drops to 22 minutes without a callback. For other databases (even twice the size), the *runtime is identical whether or not a callback is set*. This is what puzzles me. I need to figure out what makes this database so special.