Skip to main content
13 events
when toggle format what by license comment
Jun 15, 2020 at 9:05 history edited CommunityBot
Commonmark migration
Apr 10, 2018 at 7:58 comment added Gottfried Lesigang @KumarHarsh I've done so. See the updated question
Apr 10, 2018 at 7:58 history edited Gottfried Lesigang CC BY-SA 3.0
added 820 characters in body
Apr 10, 2018 at 5:34 comment added KumarHarsh It will be great if write the conclusion at the bottom of your question.Thnks
Apr 9, 2018 at 15:21 vote accept Gottfried Lesigang
Apr 9, 2018 at 14:47 comment added Aaron Bertrand But there obviously is a "slow" and "fast" database here. I'm talking about the executing context database, not the target object database. Plans are definitely not "one per sql-server"... did you even look at the execution plans for these queries?
Apr 9, 2018 at 14:46 answer added Aaron Bertrand timeline score: 1
Apr 9, 2018 at 14:39 comment added Gottfried Lesigang @AaronBertrand Might be I get this wrong... Everything is running against the same instance of SQL-Server, there is no "slow" or "fast" database... I thought, that plans are one per sql-server or are there different plans for different databases onm the same server?
Apr 9, 2018 at 14:34 comment added Aaron Bertrand Those can still have different plans associated - it doesn't matter if it's in the same window or not. Did you try any of the things I suggested?
Apr 9, 2018 at 14:24 comment added Gottfried Lesigang @AaronBertrand to avoid any misinterpretation: Just one single window, one single SELECT. With USE master; less than a second, with USE OtherDb; more than a minute. Nothing else changed... The reason seems to be, that in one case the optimizer finds a well performing route and in the other case it runs a terrible road...
Apr 9, 2018 at 14:19 comment added Gottfried Lesigang @AaronBertrand, There is no difference wheter the login is SQL or Windows. Both windows run the same query under the same user against the same environment. The only difference is the used database. (I hope I did not miss anything though)
Apr 9, 2018 at 14:17 comment added Aaron Bertrand SQL auth login? Any differences between permissions/roles on different databases? What happens if you clear the plan cache and then query from the slow database (or add OPTION (RECOMPILE))? (My guess is that you have a cached plan for each database context, and you happened to get - and are now stuck with - a slow one when you were connected to the slow database.)
Apr 9, 2018 at 14:15 history asked Gottfried Lesigang CC BY-SA 3.0