This is a theoretical question in regards to how SQL Server stores the data for a table that has a clustered index over two columns (both columns form a PK). Consider a table with columns PersonID, PersonAge and Name. I have a clusteredIndex on both PersonID and age.. how is the information store...
@JNK Thanks. Got the idea to write it after a community member was bitching about how he had to do all this manipulation to get a value from Invoke-SqlCmd because he couldn't suppress headers.
And my first thought was "well, that's because you're doing it wrong". And then suddenly blog post.
So they were simply issuing a SELECT without an ORDER BY and assuming the clustered index's order would apply.
Guys, thanks for showing me how to verify this. I think knowing how to verify this (via looking out for the SORT on the execution plan as opposed to just SELECT it and hoping to see sorted results) is worth being an "answer". If one of you puts that into an answer, I'll vote it as CORRECT. — LearnByReading16 mins ago
Is there a canonical question about that on DBA?
Trying to find one, this seems closest so far, but somehow not close enough:
This is a spin-off question from Sort order specified in primary key, yet sorting is executed on SELECT.
@Catcall says this on the subject of storage order (clustered index) and the output order
A lot of people believe that a clustered index guarantees a sort order on output. But that's not ...
If you have a user come to you wanting to know if SQL Server FileStream/FileTable is a viable option for storing around 1.3 million documents at about 1.5TB of space....would you (1) go jump of a cliff or (2) tell them to use SharePoint or (3) _____?
@JNK That is what I was thinking, not sure how their app wants to interact with the documents but that seems like a bad idea to put it in SQL Server even with Filestream.
@ShawnMelton I can't think of a reason to put it in the actual DB unless you want to leverage some HA/DR features or something, of which there are better tools for file system stuff
Or I guess if you want to use RI to delete files when the parent is deleted or something else silly
But do not restore to the original table. First create an empty table, identical to the one you want restored but without any foreign keys triggers. then restore to that table.
Then you can check data and if they are ok, you can disable triggers foreign keys (in psql) and move the data to the final destination.
(There might be a better option, just wait and someone will answer on the site)
http://support.microsoft.com/en-us/kb/2806535 Though my general rule of thumb is 1/2 number of cores up to 8, then 8. That's more anecdotal than based on any hard evidence.
Lord of Tears is a 2013 Scottish horror film directed by Lawrie Brewster. The film first released on October 25, 2013 in Whitby at the Bram Stoker International Film Festival, where it won two awards. The film follows a Scottish schoolteacher that begins to see visions of the Owl Man, a strange figure that he was obsessed with as a child.
== Plot ==
James (Euan Douglas) is an average school teacher that has been estranged from his mother for years and has only returned to her home to settle her estate after her death. This somewhat baffles his friend Allen (Jamie Scott Gordon), as his own father...
@swasheck So they say. Never really seen a convincing case myself.
I can usually find more important perf problems before I worry about local vs remote memory access. It's tough to get parallel queries to stay within a NUMA node anyway, under anything except lab conditions, even with #schedulers = NUMA node size.
Like Mike, I like 8.
All these numbers are just starting points really. Go with whatever you find convincing.
Yesterday I delivered a presentation to the client's developers (SQL & .NET) on a hodgepodge of SQL related things. One of the items I said was get the 2014 version of SSMS because it can do (all these demoed features). I do have on its very own slide: Known issue - the IS object explorer can only talk to same SQL Server version so keep your 2008 client for legacy SSIS stuff
@swasheck It uses the modified histograms that arrive at each side of the join from whatever is underneath. In the simplest case of two unfiltered tables being joined on a single column, it would be the histograms for each column from the base statistics.
Point being the two sets of histograms will generally have different low and high values, and different RANGE_HI_KEY steps in between, so alignment is necessary.
StackEgg! What a great invention. Probably the best thing to hit Stack Exchange since the invention of unicoins!
Very entertaining game, very fun to play. Many users have probably spent several hours playing this. And April Fool's day is not over yet.
However, where there is great inventions t...
I've looked at many SO questions today and until I deliberately went looking for this stackegg thing, I hadn't noticed it. I just assumed it was advertising and ignored it
@ypercube yes, that's exactly what I was expecting because the rows have to be EITHER physically OR logically sorted. Either way, the displayed rows should have been sorted first by ID then by Age... which didn't happen. However, when I used "ORDER BY", there was no "sort" function in my exec plan. — LearnByReading49 mins ago
One solution would be to normalize your database, why do you have separate tables for each product? Storing separate products in separate tables is a bad design. — bluefeet ♦2 mins ago
Shift-right click has run as different user for my windows 7. I think there's a registry setting on whether that's visible but it's been too long since I've mucked with it
I found this infographic on mobile devices, and needed help deciding which device would work better for mining unicoins. I know that the "Galaxy the Unicorn" runs Unicorn Linux, but I'm a little skeptical because it was released in 2003. Will expandable memory be a problem?
I have a Microsoft SQL table and let's say it has 10 columns. One or more of these columns may contain ALL null values. How would I construct a simple SELECT * query that excluded columns where ALL values are null?
Column order is important. This is primarily to ease importing a somewhat large dataset from a web service. And to keep in line with the consistency of other tables, where there's a business practice to stick the record origination and modification fields in the last columns of the record. These fields have proved important to keep with the data instead of in a logging table. I could go into why these are important (and their location important), but suffice to say, they are. — vol7ron8 mins ago