Any way to disable or limit Linqpad "Fetching schema"
I have a query which uses 2 databases. One of the databases is quite large with many tables, sprocs, and views. When executing a saved query which uses the connection Linqpad goes into "Fetching schema..." mode and it takes a couple of minutes due to the large schema.
Is there any way to disable the schema update or whatever Linqpad is doing for select queries, or connections? Not sure if Linqpad can cache the schema, or something like that?
Is there any way to disable the schema update or whatever Linqpad is doing for select queries, or connections? Not sure if Linqpad can cache the schema, or something like that?
Comments
Hi, @JoeAlbahari, I appreciate it's an old topic, but in our organization we just came across an issue where we run a lot of linqpad scripts on a schedule, and it creates a lot of DB overhead constantly retrieving the full schema (our DBA reported billions of logical reads over 24 hours caused by the schema retrieval query). We have inspected the sys.objects and found out there is a lot of ongoing modifications related to partitioning and full-text indexing, the objects are named like "ifts_comp_fragment_1044198770_2836519" or "fulltext_avdl_885578193". All these objects have IT (INTERNAL_TABLE) type, and there is no actual reason to invalidate the schema cache due to change in these objects .
Is it possible to exclude INTERNAL_TABLE objects from the query you mentioned above? We are using LinqPad 5.
Kind Regards
Gleb
You've made a good point: the max(modify_date) query should include a predicate that includes only types relevant to the schema being mapped. This would have the added benefit of ignoring SP/function updates when the "Include Stored Procs and Functions" checkbox hasn't been selected.
I've implemented a filter in the latest LINQPad 7 beta:
https://www.linqpad.net/linqpad7.aspx#beta
Let me know how you get on. If this doesn't cause any issues, I can backport this to LINQPad 5.
That's great, I tested and it seems it behaves as expected, however I cannot run the full test as all our scripts are under .NET Framework and we cannot port them quickly due to external dependencies. If you could add the change into LinqPad 5 Beta, it would be amazing.
Just to make sure, the change applies to both LinqPad and LPRun, correct?