Hello all, I would like to know where the best place in sqlite is to patch to have it record (syslog for unix, OutputDebugString() for windows, nothing fancy) each time it decides to use an index to satisfy a query. For that matter, also each time is runs a select query and decided to not use an index. This is only for in-house debugging. Consider it "coverage testing" of all of our SQL to determine if I have the correct indicies.
I'd like the logging to record/emit the original SQL and the names of the indicies (if any) used to execute that SQL. Our app has grown and morphed over the past two years. It has LOTS of sql in it now. Granted, I could isolate all of this sql (even the dynamically generated stuff) (select, delete, update statements) and run it through the analyzer. However, if the above mentioned "hack" is easy to do, then I would prefer the hack. I'm trying to determine is all of my indicies are actually being used, and to what frequency they are being used during a typical run of our software. I've been reading through "select.c" and "vdbe.c". I'm not sure if I should add the hack to the Virtual Machine opcode emitting code or the opcode consuming code. Maybe there is already a solution to my problem and I simply didn't see it.