Questions tagged [clustered-index]

A clustered index determines the physical order of data in a table.

A clustered index determines the physical order of data in a table. As the clustered index dictates the physical storage order of the data in the table, a table can contain only one clustered index. However, the index can comprise multiple columns (a composite index), like the way a telephone directory is organized by last name and first name.

A clustered index is particularly efficient on columns that are often searched for ranges of values.

Source: MSDN (Using Clustered Indexes)

508 questions
0
votes
2 answers

Is killing a "CLUSTER ON index" dangerous for database?

All the question is in the title, if we kill a cluster query on a 100 millions row table, will it be dangerous for database ? the query is running for 2 hours now, and i need to access the table tomorrow morning (12h left hopefully). I thought it…
Sid
  • 331
  • 2
  • 10
0
votes
1 answer

Where clause on non-clustered column that was part of a large insert

I have the following table schema: CREATE TABLE [Foo]( [id] [int] NOT NULL, [name] [varchar(250] NULL, [datetime_stamp] [datetime] NULL, CONSTRAINT [pk_Positions] PRIMARY KEY CLUSTERED ( [id] ASC)) Assuming there are inserts that…
laconicdev
  • 6,360
  • 11
  • 63
  • 89
-1
votes
1 answer

Sqlserver how to create composite unique key with one of column is nullable

i am not expert with indexing. I would like to create a composite key unique constraint. How to create if one of the column is nullable? CREATE UNIQUE CLUSTERED INDEX [IX_User_Email_PeronsId] ON [dbo].[User] ( [Email] ASC, [PersonId]…
Mukil Deepthi
  • 6,072
  • 13
  • 71
  • 156
-1
votes
1 answer

Why is this query using the index differently when i change the range of search?

I have a question about indexing and a strange (I suppose) behaviour I found when trying out some queries I'm using in a project. I have the following schema: a) an `activities`…
-1
votes
2 answers

Clustering data based on certain exemplars

I am checking a little about affinity propagation (apart from the packages that exist and are very useful). After various calculations I concluded into 4 certain exemplars for a certain pair of values that are like df[1:10, ]: X3.115997…
Stathis G.
  • 145
  • 2
  • 11
-1
votes
1 answer

Why does InnoDB require clustered index upon creating a table?

Even if I don't have a primary key or unique key, InnoDB still creates a cluster index on a synthetic column as described below. https://dev.mysql.com/doc/refman/5.5/en/innodb-index-types.html So, why does InnoDB have to require clustered index? Is…
Bonsaisteak
  • 151
  • 1
  • 8
-1
votes
1 answer

MariaDB copy table query runs quicker than original table

Scenario is: Maria db on a cluster I have a table, which is updated twice a day, when i query it takes 6-7 seconds, (it is not a big table over 100k of rows), but when i make a copy of the table and run the same query it comes back 0.7 …
user2115506
  • 23
  • 1
  • 6
-1
votes
2 answers

Which index is better non-clustered vs clustered in this case?

I have a table which has 4 columns (region_id, product_id, cate_id, month_id) as a primary key. This primary key was created as default, so a clustered index were created for PK. This table contains more than 10 millions rows. If I delete existing…
Kay
  • 1
  • 1
-1
votes
1 answer

How clustered and Non clustered index makes search faster?

Clustered indexes physically order the data on the disk. Say i have table employee and columd employee_id. Now i store values 9, 6, 10, 4 under employee_id. with clustered index on employee_id. values on disk will be stored in sorted fashion i.e 4,…
M Sach
  • 33,416
  • 76
  • 221
  • 314
-2
votes
1 answer

Can table have both primary & clustered index together

Say we have a Student table in a MYSQL database and its schema is below. This table has around Million Records. ID (PK) Name Aadhaar_ID Address Admission_year Can the above table have the following together at the same time ? Primary Index on the…
-2
votes
1 answer

Does parenthesis influence the index usage in SQL Server?

I understand that the order of criteria in the where clause does not influence index usage. Does parenthesis influence the index usage in SQL Server? Is there any example?
variable
  • 8,262
  • 9
  • 95
  • 215
-3
votes
1 answer

correct manual clusters so that to make them more relevant

I have clusters. They are done manually. I know that machine learning algorithms aim to segment profiles efficiently, but I don't to loose the cluster I have. I just wanna change them slightly to make them relevant. Surely the result won't be as…
-6
votes
3 answers

SQL server command help and tutorials for specific commands?

I saw the command in my book project (book - teach yourself SQL in 10 mins, 2004): ALTER TABLE Customers WITH NOCHECK ADD CONSTRAINT PK_Customers PRIMARY KEY CLUSTERED (cust_id); Can you tell me what these commands mean (or give links with simple…
1 2 3
33
34