SQLite Forum

SQLite .NET: CommandBuilder performs really bad on tables with a lot of indexes
Login
FWIW, I agree with Warren's comments to your post 3. I would not be so quick to dismiss schema (and corresponding data) restructuring to solve a performance issue. After all, all those "mumble###" columns are bound to be highly similar to each other and subject to a readily automated disassociation into another table. You've probably seen the old saw about a patient telling his doctor that it hurts when he does X, then being advised to stop doing X.

Getting back to your narrowly defined problem: There is clearly no actual querying, updating, inserting or deleting going on in that timed stretch of VB code. If (as you argue) the calls are reaching the SQLite.NET library, I would think that the most work being done then would be for the adapter layer to be creating some prepared statements. If you could just post here the SQL that goes into that process, (as verbose as it will be), that SQL could at least be submitted to the SQLite CLI shell so folks here can do something beyond gaze at VB.NET code and wonder if anybody really expects somebody to get Visual Studio and VB.NET installed just for that purpose. (We see very little VB code here, and I expect familiarity with it is lacking here. The only reason I can read it is past experience; I never install VB.NET because C# is such a clearly superior way of targeting the .NET CLR.)

I think that once somebody determines that, yes, hundreds of columns bog down statement preparation, the response is likely to be that a schema change is needed. I doubt that the code asked to deal with hundreds of columns and a multitude of indices is going to be sped up soon, and probably never will be if that would slow down more reasonable use cases or require more memory for them. I am highly skeptical that getting to a more reasonable schema would be all that difficult for whoever owns it, (unless they are mentally challenged.) Of course, if it is something set by a separate corporate entity, (or even an IT group), it may be cast in concrete for you. (In that case, I hope I do not own any of the company's stock.)