clustered-index

How can I tell if a database table is being accessed anymore? Want something like a “SELECT trigger”

陌路散爱 提交于 2019-11-27 00:00:10
问题 I have a very large database with hundreds of tables, and after many, many product upgrades, I'm sure half of them aren't being used anymore. How can I tell if a table is is actively being selected from? I can't just use Profiler - not only do I want to watch for more than a few days, but there are thousands of stored procedures as well, and profiler won't translate the SP calls into table access calls. The only thing I can think of is to create a clustered index on the tables of interest,

Mysql How do you create a clustered index?

元气小坏坏 提交于 2019-11-26 20:40:08
问题 I'm reading all about how clustered indexes work, and think they would be beneficial to my app. I understand that primary keys are automatically clustered indexes, but how would you add a clustered index to a non-primary key column? I.e. a datastore for user posts. Each post has a ID, but also has a user-id, but since users can post multiple times, the user-id is not a primary key. How would you add a clustered index to the user-id, and is that even a good idea? 回答1: According to Clustered

SQL Server - When to use Clustered vs non-Clustered Index?

泄露秘密 提交于 2019-11-26 18:44:23
问题 I know primary differences between clustered and non clustered indexes and have an understanding of how they actually work. I understand how clustered and non-clustered indexes improve read performance. But one thing I am not sure is that what would be the reasons where I would choose one over the other. For example: If a table does not have a clustered index, should one create a non-clustered index and whats the benefit of doing 回答1: I just want to put in a word of warning: please very

Do clustered indexes have to be unique?

筅森魡賤 提交于 2019-11-26 17:30:53
What happens if a clustered index is not unique? Can it lead to bad performance because inserted rows flow to an "overflow" page of some sorts? Is it "made" unique and if so how? What is the best way to make it unique? I am asking because I am currently using a clustered index to divide my table in logical parts, but the performance is so-so, and recently I got the advice to make my clustered indexes unique. I'd like a second opinion on that. Thanks! Lieven Keersmaekers They don't have to be unique but it certainly is encouraged. I haven't encountered a scenario yet where I wanted to create a

Improving performance of cluster index GUID primary key

若如初见. 提交于 2019-11-26 09:52:37
问题 I\'ve a table with large number of rows (10K+) and it primary key is GUID. The primary key is clustered. The query performance is quite low on this table. Please provide suggestions to make it efficient. 回答1: You need to use newsequentialid() instead see here Some Simple Code To Show The Difference Between Newid And Newsequentialid 回答2: A clustered index on GUID is not a good design. The very nature of GUID is that it's random, while a clustered index physically orders the records by the key.

Do clustered indexes have to be unique?

守給你的承諾、 提交于 2019-11-26 05:27:59
问题 What happens if a clustered index is not unique? Can it lead to bad performance because inserted rows flow to an \"overflow\" page of some sorts? Is it \"made\" unique and if so how? What is the best way to make it unique? I am asking because I am currently using a clustered index to divide my table in logical parts, but the performance is so-so, and recently I got the advice to make my clustered indexes unique. I\'d like a second opinion on that. Thanks! 回答1: They don't have to be unique but

What do Clustered and Non clustered index actually mean?

六月ゝ 毕业季﹏ 提交于 2019-11-25 22:47:45
问题 I have a limited exposure to DB and have only used DB as an application programmer. I want to know about Clustered and Non clustered indexes . I googled and what I found was : A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages. A nonclustered index is a special type of index in which the logical order of the index does not