Keeping the server busy
-
Extracted from a really slow stored proc:
SELECT 0 * Sum(IIf([amortisedClosePriceIssueYld]=0 Or [amortisedClosePrice]=0,0,-[bsqflag]*[closedq]*[valpoint]*([amortisedClosePriceIssueYld]-[amortisedtpissueyld]))) AS LocalRealisedAmortIssue FROM ((((PL1RPLCloseOuts INNER JOIN seclocal AS sec ON PL1RPLCloseOuts.id = sec.id) LEFT JOIN SecTypeValidationRuleslocal AS SecTypeValidationRules ON sec.sectype = SecTypeValidationRules.sectype) INNER JOIN TradeFundlocal AS TradeFund ON PL1RPLCloseOuts.fund = TradeFund.fund) INNER JOIN tradetlocal AS TradeT ON PL1RPLCloseOuts.tt = TradeT.tt) INNER JOIN PL1RplTaxlots ON (PL1RPLCloseOuts.tnum = PL1RplTaxlots.tnum) AND (PL1RPLCloseOuts.tt = PL1RplTaxlots.tt)
Yes indeed - do a huge amount of maths and multiply the resulting figure by zero...oh'--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
Extracted from a really slow stored proc:
SELECT 0 * Sum(IIf([amortisedClosePriceIssueYld]=0 Or [amortisedClosePrice]=0,0,-[bsqflag]*[closedq]*[valpoint]*([amortisedClosePriceIssueYld]-[amortisedtpissueyld]))) AS LocalRealisedAmortIssue FROM ((((PL1RPLCloseOuts INNER JOIN seclocal AS sec ON PL1RPLCloseOuts.id = sec.id) LEFT JOIN SecTypeValidationRuleslocal AS SecTypeValidationRules ON sec.sectype = SecTypeValidationRules.sectype) INNER JOIN TradeFundlocal AS TradeFund ON PL1RPLCloseOuts.fund = TradeFund.fund) INNER JOIN tradetlocal AS TradeT ON PL1RPLCloseOuts.tt = TradeT.tt) INNER JOIN PL1RplTaxlots ON (PL1RPLCloseOuts.tnum = PL1RplTaxlots.tnum) AND (PL1RPLCloseOuts.tt = PL1RplTaxlots.tt)
Yes indeed - do a huge amount of maths and multiply the resulting figure by zero...oh'--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
You would think a product as sophisticated as SQL Server would be able to optimize that down...
-
Extracted from a really slow stored proc:
SELECT 0 * Sum(IIf([amortisedClosePriceIssueYld]=0 Or [amortisedClosePrice]=0,0,-[bsqflag]*[closedq]*[valpoint]*([amortisedClosePriceIssueYld]-[amortisedtpissueyld]))) AS LocalRealisedAmortIssue FROM ((((PL1RPLCloseOuts INNER JOIN seclocal AS sec ON PL1RPLCloseOuts.id = sec.id) LEFT JOIN SecTypeValidationRuleslocal AS SecTypeValidationRules ON sec.sectype = SecTypeValidationRules.sectype) INNER JOIN TradeFundlocal AS TradeFund ON PL1RPLCloseOuts.fund = TradeFund.fund) INNER JOIN tradetlocal AS TradeT ON PL1RPLCloseOuts.tt = TradeT.tt) INNER JOIN PL1RplTaxlots ON (PL1RPLCloseOuts.tnum = PL1RplTaxlots.tnum) AND (PL1RPLCloseOuts.tt = PL1RplTaxlots.tt)
Yes indeed - do a huge amount of maths and multiply the resulting figure by zero...oh'--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
:wtf: I saw the "SELECT 0 * Sum" and immediately thought this was a joke. Apparently I was wrong. :doh:
Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:
-
You would think a product as sophisticated as SQL Server would be able to optimize that down...
Only if the SQL standard allows it to.
-
Extracted from a really slow stored proc:
SELECT 0 * Sum(IIf([amortisedClosePriceIssueYld]=0 Or [amortisedClosePrice]=0,0,-[bsqflag]*[closedq]*[valpoint]*([amortisedClosePriceIssueYld]-[amortisedtpissueyld]))) AS LocalRealisedAmortIssue FROM ((((PL1RPLCloseOuts INNER JOIN seclocal AS sec ON PL1RPLCloseOuts.id = sec.id) LEFT JOIN SecTypeValidationRuleslocal AS SecTypeValidationRules ON sec.sectype = SecTypeValidationRules.sectype) INNER JOIN TradeFundlocal AS TradeFund ON PL1RPLCloseOuts.fund = TradeFund.fund) INNER JOIN tradetlocal AS TradeT ON PL1RPLCloseOuts.tt = TradeT.tt) INNER JOIN PL1RplTaxlots ON (PL1RPLCloseOuts.tnum = PL1RplTaxlots.tnum) AND (PL1RPLCloseOuts.tt = PL1RplTaxlots.tt)
Yes indeed - do a huge amount of maths and multiply the resulting figure by zero...oh'--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
Perhaps a marriage of SQLServer with Unix. :) There is something in Unix where you can divert junk files (howmuch ever huge it is, even beyond the capacity of the disk) to an infine sink called
/dev/null
.Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
Perhaps a marriage of SQLServer with Unix. :) There is something in Unix where you can divert junk files (howmuch ever huge it is, even beyond the capacity of the disk) to an infine sink called
/dev/null
.Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonMySQL has a fantastic storage engine called "Blackhole" It supports Inserts only, not deletes, selects or Updates.
-
Only if the SQL standard allows it to.
I suppose theoretically the maths calc could have side effects.
Bram van Kampen
-
Perhaps a marriage of SQLServer with Unix. :) There is something in Unix where you can divert junk files (howmuch ever huge it is, even beyond the capacity of the disk) to an infine sink called
/dev/null
.Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonVasudevan Deepak K wrote:
something in Unix
DOS and OpenVMS also have null devices.