Click here to Skip to main content
15,897,315 members
Home / Discussions / Database
   

Database

 
AnswerRe: Self-join to return either/or results? Pin
David Mujica17-Nov-11 6:17
David Mujica17-Nov-11 6:17 
GeneralRe: Self-join to return either/or results? Pin
AHSTech17-Nov-11 7:14
AHSTech17-Nov-11 7:14 
AnswerRe: Self-join to return either/or results? Pin
SilimSayo18-Nov-11 4:53
SilimSayo18-Nov-11 4:53 
AnswerRe: Self-join to return either/or results? Pin
Chris Meech18-Nov-11 6:13
Chris Meech18-Nov-11 6:13 
GeneralRe: Self-join to return either/or results? Pin
SilimSayo18-Nov-11 6:53
SilimSayo18-Nov-11 6:53 
GeneralRe: Self-join to return either/or results? Pin
Chris Meech18-Nov-11 7:46
Chris Meech18-Nov-11 7:46 
QuestionSSIS - SQL Job Pin
Sun Rays17-Nov-11 5:41
Sun Rays17-Nov-11 5:41 
Question"Lazy Spool" problem Pin
Bernhard Hiller17-Nov-11 1:00
Bernhard Hiller17-Nov-11 1:00 
A simple query with a left join sues to run quickly on SQL Server, but only with one parameter changed, it takes almost a minute.
The query is something like:
SQL
SELECT Table1.*, Table2.*
FROM Table1 Left JOIN Table2 ON Table1.ID=Table2.Table1ID
WHERE (Table1.Col1=38 OR Table1.Col1=-1) AND Table1.Col2=0

That produces around 280 lines of output in a second.
When we change Col1=38 to Col1=114, it produces some 320 lines of output, in almost a minute!
We looked at the execution plan, and in the second case we found an extra "Lazy Spool" not present in the first query, which was estimate to cost a percent.
When I looked at that "Lazy Spool", I found a striking difference between estimated and actual values:
Actual Number of Rows:75124744
Estimated Number of Rows: 708724
That is more than a hundred times as much as estimated!
Actual Rebinds was 1, and Actual Rewinds 105!
Can you guess what went wrong here?
AnswerRe: "Lazy Spool" problem Pin
R. Giskard Reventlov17-Nov-11 1:47
R. Giskard Reventlov17-Nov-11 1:47 
JokeRe: "Lazy Spool" problem Pin
Bernhard Hiller18-Nov-11 0:46
Bernhard Hiller18-Nov-11 0:46 
AnswerRe: "Lazy Spool" problem Pin
Jörgen Andersson17-Nov-11 3:45
professionalJörgen Andersson17-Nov-11 3:45 
GeneralRe: "Lazy Spool" problem Pin
Bernhard Hiller18-Nov-11 0:47
Bernhard Hiller18-Nov-11 0:47 
QuestionDatabase Mail 2008 problem Pin
Falconapollo16-Nov-11 22:49
Falconapollo16-Nov-11 22:49 
AnswerRe: Database Mail 2008 problem Pin
Mycroft Holmes16-Nov-11 23:15
professionalMycroft Holmes16-Nov-11 23:15 
QuestionNeed help...asp.net count sql.. Pin
mat daus16-Nov-11 21:33
mat daus16-Nov-11 21:33 
AnswerRe: Need help...asp.net count sql.. Pin
Mycroft Holmes16-Nov-11 21:43
professionalMycroft Holmes16-Nov-11 21:43 
GeneralRe: Need help...asp.net count sql.. Pin
mat daus16-Nov-11 21:51
mat daus16-Nov-11 21:51 
GeneralRe: Need help...asp.net count sql.. Pin
Mycroft Holmes16-Nov-11 23:12
professionalMycroft Holmes16-Nov-11 23:12 
GeneralRe: Need help...asp.net count sql.. Pin
mat daus16-Nov-11 21:58
mat daus16-Nov-11 21:58 
QuestionError in sql command when using ado in VC++ and unicode Pin
mazen keeikati16-Nov-11 11:06
professionalmazen keeikati16-Nov-11 11:06 
QuestionError in sql command when using ado in VC++ and unicode Pin
mazen keeikati16-Nov-11 11:05
professionalmazen keeikati16-Nov-11 11:05 
AnswerRe: Error in sql command when using ado in VC++ and unicode Pin
Mycroft Holmes16-Nov-11 13:40
professionalMycroft Holmes16-Nov-11 13:40 
GeneralRe: Error in sql command when using ado in VC++ and unicode Pin
mazen keeikati17-Nov-11 9:20
professionalmazen keeikati17-Nov-11 9:20 
AnswerRe: Error in sql command when using ado in VC++ and unicode Pin
Luc Pattyn17-Nov-11 9:28
sitebuilderLuc Pattyn17-Nov-11 9:28 
QuestionTrying My First DataGridView Project Pin
Roger Wright15-Nov-11 20:26
professionalRoger Wright15-Nov-11 20:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.