April 10, 2015 at 4:29 pm
Luis Cazares (4/10/2015)
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you just had two clustered indexes on a table, you'd be set. INCLUDE all the columns, and it's exactly the same as a second clustered index. Done.
I guess I'm high...
CREATE TABLE dbo.T1 (col1 INTEGER PRIMARY KEY CLUSTERED, col2 INTEGER);
GO
CREATE VIEW dbo.V1 WITH SCHEMABINDING AS SELECT col1, col2 FROM dbo.T1;
GO
CREATE UNIQUE CLUSTERED INDEX ci_v1 ON dbo.V1 (col2);
GO
Want a third one?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 10, 2015 at 4:51 pm
WayneS (4/10/2015)
Luis Cazares (4/10/2015)
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you just had two clustered indexes on a table, you'd be set. INCLUDE all the columns, and it's exactly the same as a second clustered index. Done.
I guess I'm high...
CREATE TABLE dbo.T1 (col1 INTEGER PRIMARY KEY CLUSTERED, col2 INTEGER);
GO
CREATE VIEW dbo.V1 WITH SCHEMABINDING AS SELECT col1, col2 FROM dbo.T1;
GO
CREATE UNIQUE CLUSTERED INDEX ci_v1 ON dbo.V1 (col2);
GO
Want a third one?
I want the second one either for the table or the view. :hehe:
April 11, 2015 at 2:50 am
Does anyone have an idea on how to solve this problem?
😎
April 12, 2015 at 5:09 pm
Eirikur Eiriksson (4/10/2015)
GilaMonster (4/10/2015)
I love finding out that I'm giving a training course from the newsletter sent out the the entire company.Especially when it's pushed forward to the day of the publication, had one of those not to far back and ended up using some of the problems posted here on SSCentral as the examples, in fact when I found out/read the newsletter, people were already waiting:-D
😎
It can be even worse when the audience is external, or when what you say is going to determine wheter someone's proposal gets funcing and it comes to you with no notice.
I was once caught out at a meeting that I attended after being assured by my boss that I would not be required to present anything and discovered on arrival that I was billed as explaining how industry was working on the meeting's topic.
Another time I was asked to act as an evaluator for a proposal because someone couldn't make it, and given the impression I would be just a junior on the team so wouldn't have to do anything but apply technical judgement and state my opinion, so booked flights that would allow me to depart from and return to the UK on the same day as the proceedings were scheduled for about 5 hours; once the meeting was under way I discovered that I was to be the formal reporter for the process and had to obtain/engineer a concensus, and that the report was required for the same day, so that I would need to spend several hours after the meeting preparing a report and handing it over to the bureaucrats, leaving me with no chance at all of gettting on my flight back, and would need to find overnight accomodation in a city that was full of visitors because a massively attractive event (to others, not to people like me) was happening there. (I was worried at first, but much less worried once I had I discovered how magically EU bureaucrats could find a room in hotels that said they had no space, and persuade (or pay) an airline to adjust my non-adjustable ticket.)
I regard this sort of thing as a learning opportunity, difficult and painful at the time, but in retrospect something really valuable as a learning experience. But I didn't feel that way at all the first couple of times it happened to me.
Tom
April 12, 2015 at 5:21 pm
Grant Fritchey (4/10/2015)
Brandie Tarvin (4/10/2015)
Look, Grant, there's a reason you didn't get the circus job. We just didn't want to break the news to you.<squeak>really?</squeak>
And I showered and everything.
Well, that may have contributed to the wet droopy hat problem, and the appearance of having somehow made your trousers (and jacket) wet. So when you shower, try to remember not to take off the things you'll need in their dry form unless you have time to dry them before the need becomes critical.
Oh: also, remember to put them on again after showering but before you need them.
Tom
April 13, 2015 at 2:22 am
Grant Fritchey (4/10/2015)
Is everyone OK? Are people ill or something? Because this just happened and it has me concerned:
Work deadlines and other stuff. Sorry, will do better next month
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 13, 2015 at 2:27 am
Luis Cazares (4/10/2015)
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you just had two clustered indexes on a table, you'd be set. INCLUDE all the columns, and it's exactly the same as a second clustered index. Done.
Well, kinda...
An index that includes all the columns looks mostly like a clustered index, but it's not exactly a clustered index. For example key lookups will never be done to it, they're only ever done to the clustered index or the heap. There's a few other internal differences too.
WayneS (4/10/2015)
Luis Cazares (4/10/2015)
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you just had two clustered indexes on a table, you'd be set. INCLUDE all the columns, and it's exactly the same as a second clustered index. Done.
I guess I'm high...
CREATE TABLE dbo.T1 (col1 INTEGER PRIMARY KEY CLUSTERED, col2 INTEGER);
GO
CREATE VIEW dbo.V1 WITH SCHEMABINDING AS SELECT col1, col2 FROM dbo.T1;
GO
CREATE UNIQUE CLUSTERED INDEX ci_v1 ON dbo.V1 (col2);
GO
Want a third one?
Still only one clustered index on the *table*
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 13, 2015 at 2:30 am
Eirikur Eiriksson (4/11/2015)
Does anyone have an idea on how to solve this problem?😎
Extended events or the sys.dm_db_session_space_usage DMV which tracks tempDB usage per session (not per table, just overall space usage). Does mean you need to poll frequently so that you can join it to exec_requests and the sql_text DMVs. Extended events may be less work.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 13, 2015 at 5:04 am
GilaMonster (4/13/2015)
Luis Cazares (4/10/2015)
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you just had two clustered indexes on a table, you'd be set. INCLUDE all the columns, and it's exactly the same as a second clustered index. Done.
Well, kinda...
An index that includes all the columns looks mostly like a clustered index, but it's not exactly a clustered index. For example key lookups will never be done to it, they're only ever done to the clustered index or the heap. There's a few other internal differences too.
WayneS (4/10/2015)
Luis Cazares (4/10/2015)
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you just had two clustered indexes on a table, you'd be set. INCLUDE all the columns, and it's exactly the same as a second clustered index. Done.
I guess I'm high...
CREATE TABLE dbo.T1 (col1 INTEGER PRIMARY KEY CLUSTERED, col2 INTEGER);
GO
CREATE VIEW dbo.V1 WITH SCHEMABINDING AS SELECT col1, col2 FROM dbo.T1;
GO
CREATE UNIQUE CLUSTERED INDEX ci_v1 ON dbo.V1 (col2);
GO
Want a third one?
Still only one clustered index on the *table*
Picky, picky.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 13, 2015 at 5:28 am
DAMN.
Still getting the red X in SSMS 2012.
April 13, 2015 at 7:41 am
GilaMonster (4/13/2015)
Eirikur Eiriksson (4/11/2015)
Does anyone have an idea on how to solve this problem?😎
Extended events or the sys.dm_db_session_space_usage DMV which tracks tempDB usage per session (not per table, just overall space usage). Does mean you need to poll frequently so that you can join it to exec_requests and the sql_text DMVs. Extended events may be less work.
Tanks Gail,
Extended Events are definitely less work.
😎
April 14, 2015 at 8:43 am
And this makes 14,001 posts. My fingers are tired.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 14, 2015 at 8:57 am
Grant Fritchey (4/14/2015)
And this makes 14,001 posts. My fingers are tired.
Did you mean 0x3A99?
😎
April 14, 2015 at 9:36 am
Grant Fritchey (4/14/2015)
And this makes 14,001 posts. My fingers are tired.
Congrats!
(and you widened the gap between us. Well done old man :-P)
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
April 14, 2015 at 10:40 am
Grant Fritchey (4/14/2015)
And this makes 14,001 posts. My fingers are tired.
Well done, Grant. I'd say you've earned a victory beer, so enjoy it.
Viewing 15 posts - 48,181 through 48,195 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply