improvedk
-
@ Oh, and thanks by the way :)
about 4 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Sorry, I will try to reduce my usage. In this case it was truly agonizing though :)
about 4 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Would you agree in the conclusion in the last two paragraphs (no need to read rest)?
about 4 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Just tried adding to both, no change. Column is nullable on Z but not on X.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Let me post the full query + stats on DBA so it's easier to show what I've got. 5 min.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Makes sense yes - and Y is nullable on Z. However, I've got a WHERE Y IS NOT NULL predicate in the inner query though.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ a large row count discrepancy between the tables (500 vs 50 million). Y being the primary key of X. 2/2
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ That does the trick! Interesting. So because there's no cardinality stats for Y, it assumes the worst, even with such 1/2
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ That gives the exact same execution plan - probably being rewritten to the same internally. I'll post plans & query on DBA.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ And you can assume ~500 rows in X, about ~50 million in Z - thus those 500 scans of Z are somewhat expensive.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Instead of doing a RBAR scan on Z for each row in X.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ Assume no indexes on Y in Z. A scan is required. I just don't see why it wouldn't create a worktable and use that temporarily.
about 5 hours ago
via TweetDeck
in reply to AdamMachanic
-
@ And I of course meant a scan of Z, not Y.
about 5 hours ago
via TweetDeck
in reply to improvedk
-
DELETE FROM X WHERE Y NOT IN (SELECT Y FROM Z) <- Why does that cause a scan of Y for each row in X? Wouldn't a worktable do it?
about 5 hours ago
via TweetDeck
-
@ Just as you can package HTML/JS to a native app using PhoneGap, you can embed LUA in a native wrapper.
about 5 hours ago
via TweetDeck
in reply to MladenPrajdic
-
@ No, but LUA interpreters come as libraries that you can embed inside apps that run natively. Flame contained a LUA VM.
about 5 hours ago
via TweetDeck
in reply to MladenPrajdic
-
@ That's no different from SQL, JavaScript, Java, .NET, etc. It won't run natively but if you've got the environment, sure.
about 5 hours ago
via TweetDeck
in reply to MladenPrajdic
-
@ Didn't I tell you to stay away from shrooms?
about 6 hours ago
via TweetDeck
in reply to MladenPrajdic
-
@ Ah, I see. May God Save the Queen :)
about 11 hours ago
via TweetDeck
in reply to tonyrogerson
-
@ Wait, it isn't?
about 12 hours ago
via TweetDeck
in reply to tonyrogerson
|
- Name Mark S. Rasmussen
- Location Aarhus, Denmark
- Web http://improve.dk
- Bio Has a secret love affair with SQL Server internals. Author of the OrcaMDF project. Speaker, consultant, SQL Server & C# groupie. Tech Lead @ iPaper A/S.
|