Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««4,3764,3774,3784,3794,380»»»

Are the posted questions getting worse? Expand / Collapse
Author
Message
Posted Tuesday, April 22, 2014 7:30 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:09 AM
Points: 6,750, Visits: 13,896
GilaMonster (4/22/2014)
ChrisM@Work (4/22/2014)
[quote][b]The question I'm asking is here - http://www.sqlservercentral.com/Forums/FindPost1563832.aspx and the query, to save you a few moments, is this:

select  KeyInstn, MAX(dateendedstandard) DateEndedStandard 
from ObjectViews..InternalOperCBGEstimate
where dateendedstandard < @Current
and mostrecentsequence = 1
and UpdOperation<2
group by KeyInstn

I've set up a test table here which relies on one of our real tables, if you like I could set up a test table generator to give you something to code against.


First thing to note is that the query mentions ObjectViews..InternalOperCBGEstimate, but according to the plan, the table name is [InternalUseOnly_New].[dbo].[OperatorCBGEstimate]. I suspect ObjectViews..InternalOperCBGEstimate is actually a view (from the name of the DB)

So the columns which come out of the index seek are:
KeyInstn and DateEndedStandard. I can't see anywhere the other columns you mentioned, looking at the plan in the post you quoted there.

...snip...


Sorry if that was ambiguous - the plan is Stream_plan.sqlplan, from this post.

And yes, every other plan the OP posted show only KeyInstn and DateEndedStandard coming out of the index seek, as you'd expect.
Systems here won't let me anywhere his table and index defs, so I don't know the definition of index [AI_OperatorCBGEstimate_HAP].


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1563847
Posted Tuesday, April 22, 2014 7:42 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 9:28 PM
Points: 17,729, Visits: 15,597
Ok, did he use a cherry bomb on that fish instead of a filet knife?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1563852
Posted Tuesday, April 22, 2014 8:10 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:09 AM
Points: 6,750, Visits: 13,896
Greg Edwards-268690 (4/22/2014)
ChrisM@Work (4/22/2014)
Greg Edwards-268690 (4/22/2014)
Ed Wagner (4/22/2014)
dwain.c (4/21/2014)
Greg Edwards-268690 (4/21/2014)
TomThomson (4/20/2014)
Greg Edwards-268690 (4/20/2014)
Bucket List Challenge - teach Jim to Filet a fish properly.
I'll keep trying, but I may fail miserably.

Fillet "a fish" is not a good test. I can fillet brown trout, dover sole, lemon sole, sea trout, see bass, hake, lythe, saithe, and salmon (and a few other NE Atlantic and Mediterranean fish whose English names I dont know) because they are worth filleting. I can also fillet rainbow trout, but most Americans and Canadians who know me think I can't because my method of filleting it doesn't separate any bits (I just chuck the whole fish in the rubbish bin). I haven't a clue how to fillet the sort of stuff that you guys catch (well, maybe my rainbow trout treatment would be appropriate, but maybe not) but I don't think that detracts from my dba abilities, because actually, I have no dba abilites to detract from - I'm totally aganst this over-specialisation thing that invented dbas - but I have to admit I'm probably overspecialised when it comes to fish filleting.


If I could teach Jim to filet a fish properly, like I could teach him to do anything.
Ever have someone "I've got it", then blazes ahead doing exactly what you've said not to do?
Mike and I filet, so Jim and Anatoly can have some fish to eat.
Never have gotten Anatoly to wield a knife, so I feel we have a second challenge available.


Buy a man a fish and he can feed his family for a day.
Teach a man to fish and he can feed his family forever.
Teach a man to fillet a fish and he can still only feed his family for a day.

From the look of Dwain's fish and considering the type of fish they have in that part of the world, he might feed the family for more than a day.


Jim might make it only a small family, given some luck.
Part of the odd filet count when Jim helps might just be due to it is hard to determine what to keep.
Boneless would eliminate everything, and something with meat is just about as scarce.
I will post an update after Mike and I have had a couple more attempts to teach the skill again this summer.
Glad that we usually catch plenty of fish, so it's not horrible to lose a few for practice.

I can't believe I'm reading this - here, of all places
One of many skills my father patiently taught when I was old enough to know that if I did it really badly I might get out of it as a chore. When the fish you've just caught is your best bet for the next meal or three, you soon learn how not to waste it and also how to cut so that it doesn't fall to bits during cooking. The same technique - the slow, accurate one, not the quick commercial one - works on every single fish I've ever had the pleasure of eating.
Does anyone around here know anything about output lists from index seek operators, by any chance? Don't all raise your hands at once, you might drop your rod...


Slow Down? Get it right, the speed will come?
Might have to UTube this sometime, and you can see what Mike and I are doing wrong.
Maybe Jim can't hear?

My rod just fell in the lake - that was a mean trick.


Could have been your smartfone

The easiest method I've seen was shown to me by a prawn fisherman in Ullapool and I've only tried it with herring but it would probably work with other similar-sized oily fish like mackerel. Put the fish belly-down on a hard flat surface and thump it along the back so that it just deforms and no more. Pick it up, pinch off the head, then slip your thumb from the head end of the cavity along the backbone on both sides, feeling your way and separating the flesh from the bone. It takes about 15 seconds at a guess but you don't want to be wearing your best cashmere sweater when you do it.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1563871
Posted Tuesday, April 22, 2014 8:38 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 29, 2014 8:08 PM
Points: 1,328, Visits: 19,288
Greg Edwards-268690 (4/22/2014)
Brandie Tarvin (4/22/2014)
*THAT* is a filleted fish?

Ummm, would you take it the wrong way if I begged you to keep your day job and forget about opening that restaurant? @=)


I said Jim was a challenge.
At least you can see it once was a fish.
For some reason, I'd bet he didn't get A's in biology for dissecting a frog.
Jeebus. Full disclosure, I have never filleted a fish of any kind, but I suspect I might be able to achieve what I see in that picture by using my bare hands. Or a hammer.


---------------------------------------------------------
How best to post your question
How to post performance problems
Tally Table:What it is and how it replaces a loop

"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
Post #1563883
Posted Tuesday, April 22, 2014 9:16 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 1:30 AM
Points: 39,977, Visits: 36,341
ChrisM@Work (4/22/2014)
And yes, every other plan the OP posted show only KeyInstn and DateEndedStandard coming out of the index seek, as you'd expect.
Systems here won't let me anywhere his table and index defs, so I don't know the definition of index [AI_OperatorCBGEstimate_HAP].


Might have something to do with the columns being needed for predicate, not seek predicate. Maybe filter operation folded into index seek or something similar.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1563900
Posted Tuesday, April 22, 2014 9:52 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:09 AM
Points: 6,750, Visits: 13,896
GilaMonster (4/22/2014)
ChrisM@Work (4/22/2014)
And yes, every other plan the OP posted show only KeyInstn and DateEndedStandard coming out of the index seek, as you'd expect.
Systems here won't let me anywhere his table and index defs, so I don't know the definition of index [AI_OperatorCBGEstimate_HAP].


Might have something to do with the columns being needed for predicate, not seek predicate. Maybe filter operation folded into index seek or something similar.

None of the other plans show anything like this behaviour
I'm beginning to think the OP changed the query in the .sqlplan file.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1563931
Posted Tuesday, April 22, 2014 9:59 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 7:58 PM
Points: 20,705, Visits: 32,356
ChrisM@Work (4/22/2014)
GilaMonster (4/22/2014)
ChrisM@Work (4/22/2014)
And yes, every other plan the OP posted show only KeyInstn and DateEndedStandard coming out of the index seek, as you'd expect.
Systems here won't let me anywhere his table and index defs, so I don't know the definition of index [AI_OperatorCBGEstimate_HAP].


Might have something to do with the columns being needed for predicate, not seek predicate. Maybe filter operation folded into index seek or something similar.

None of the other plans show anything like this behaviour
I'm beginning to think the OP changed the query in the .sqlplan file.


Possible considering how much trouble he goes to trying to obfuscate everything before posting. He goes so far as things don't always match up between the query(queries) and the DDL he provides.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1563938
Posted Tuesday, April 22, 2014 10:16 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:18 PM
Points: 35,267, Visits: 31,759
ChrisM@Work (4/22/2014)

The easiest method I've seen was shown to me by a prawn fisherman in Ullapool and I've only tried it with herring but it would probably work with other similar-sized oily fish like mackerel. Put the fish belly-down on a hard flat surface and thump it along the back so that it just deforms and no more. Pick it up, pinch off the head, then slip your thumb from the head end of the cavity along the backbone on both sides, feeling your way and separating the flesh from the bone. It takes about 15 seconds at a guess but you don't want to be wearing your best cashmere sweater when you do it.


Dammit! I guess I'm going to have to sue that guy for process patent infringement... that's the same process I use on developers that don't follow company coding standards.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1563947
Posted Tuesday, April 22, 2014 10:34 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 12:47 AM
Points: 1,031, Visits: 6,731
Jeff Moden (4/22/2014)
ChrisM@Work (4/22/2014)

The easiest method I've seen was shown to me by a prawn fisherman in Ullapool and I've only tried it with herring but it would probably work with other similar-sized oily fish like mackerel. Put the fish belly-down on a hard flat surface and thump it along the back so that it just deforms and no more. Pick it up, pinch off the head, then slip your thumb from the head end of the cavity along the backbone on both sides, feeling your way and separating the flesh from the bone. It takes about 15 seconds at a guess but you don't want to be wearing your best cashmere sweater when you do it.


Dammit! I guess I'm going to have to sue that guy for process patent infringement... that's the same process I use on developers that don't follow company coding standards.

No second chances then - quite right too. Spare spines left over for anyone who needs one



Low-hanging fruit picker and defender of the moggies





For better assistance in answering your questions, please read this.




Understanding and using APPLY, (I) and (II) Paul White

Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Post #1563959
Posted Tuesday, April 22, 2014 10:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, September 24, 2014 8:54 AM
Points: 5,579, Visits: 6,363
Jeff Moden (4/22/2014)
ChrisM@Work (4/22/2014)

The easiest method I've seen was shown to me by a prawn fisherman in Ullapool and I've only tried it with herring but it would probably work with other similar-sized oily fish like mackerel. Put the fish belly-down on a hard flat surface and thump it along the back so that it just deforms and no more. Pick it up, pinch off the head, then slip your thumb from the head end of the cavity along the backbone on both sides, feeling your way and separating the flesh from the bone. It takes about 15 seconds at a guess but you don't want to be wearing your best cashmere sweater when you do it.


Dammit! I guess I'm going to have to sue that guy for process patent infringement... that's the same process I use on developers that don't follow company coding standards.


Jeff, may I have permission to use your patented Dev Treatment here at my workplace? @=)


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1563969
« Prev Topic | Next Topic »

Add to briefcase «««4,3764,3774,3784,3794,380»»»

Permissions Expand / Collapse