Tagged Questions
1
vote
3answers
49 views
Nonclustered index is faster than clustered index?
Both tables have same structure and 19972 rows in each table.
for practicing indexing, i created both tables having same structure and created
clustered index on persontb(BusinessEntityID)
and
...
3
votes
2answers
67 views
If I update a column record in a table, will indexes that do NOT have this column in it be affected?
In terms of performance if I have a table like so:
CREATE TABLE [TESTDATA].[TableA](
[Col1] [nchar](5) NOT NULL,
[Col2] [nchar](2) NULL,
[Col3] [float] NULL
CONSTRAINT [TableA_PK] PRIMARY ...
0
votes
1answer
54 views
Can I use the database and query it while full-text indexing?
I need to index my database, but I need to query it while it is indexing, it may take a long time, can I do that?
4
votes
1answer
151 views
Indexes file damaged, was on ramdisk
I have put some of my indexes into a filegroup that contains one file, that file is on the ramdisk, the performance is great, but the problem is that the file was deleted incorrectly (the file ...
1
vote
2answers
130 views
Clustered vs Nonclustered Index
My database currently has a primary Key/Clustered index on the ID column for each table. However, the application that connects to the database is always looking at views defined as:
SELECT * FROM ...
5
votes
2answers
270 views
Recreate Indexes on 1 billion record table
I have a table with over 1 billion records and it has 6 indexes (including Clustered index (ID)). I need to partition this table on a new Clustered index with date column. I have just enough space ...
3
votes
0answers
82 views
Key Lookup and Full-text index
I have the following query:
SELECT T2.Title
FROM TitleTable T1
INNER JOIN TitleTable T2 ON T2.FKID1 = T1.FKID1
WHERE T1.FKID2 = @ID_PARAM1
AND T2.FKID2 = @ID_PARAM2
AND ...
3
votes
1answer
379 views
Is a clustered index locked while a (clustered index) scan is in progress?
The question is pretty simple, as the title says. However, I cannot find any references to confirm or contradict this.
The problem leading me to this question is that I have a view joining several ...
1
vote
1answer
68 views
Issues on defining a PK on a nvarchar column and indexing the FK referring this PK
Someone from the team, has defined two reference tables with a few records in each, and has defined the PK of these tables on a column of type nvarchar(255).
The value exists in this columns are ...
11
votes
3answers
739 views
Is there any benefit to defragmenting SQL indexes in a SAN environment?
Our SQL server lives on a SAN. It contains dozens of OLTP databases, some with several tables containing over 1m records.
We have been running Ola Hallengren's index maintenance scripts weekly, and ...
5
votes
2answers
501 views
Best value for fill factor in index
I use SQL Server 2008 R2 and want to set value for fill factor property in each index. I look for recipe to calculate best value for this property (have better performance when insert record) . Also ...
5
votes
2answers
1k views
Why is this query not using my nonclustered index, and how can I make it?
As follow up to this question about increasing query performance, I'd like to know if there is a way to make my index used by default.
This query runs in about 2.5 seconds:
SELECT TOP 1000 * FROM ...
2
votes
2answers
330 views
rebuilding indexes and logshipping?
We all know that index rebuilding creates lot of log growth..so what changes would you consider to your logshipping side to accomodate this log growth?
Do we increase the frequency of the ...
5
votes
2answers
250 views
Partition Function vs. Clustered Index
We have a table that is clustered on identity/datetime2. It is partitioned on the same datetime2. Are there any reasons to cluster on datetime2/identity instead? I understand the reasoning behind ...
5
votes
3answers
425 views
Does having an index on a VARCHAR column with a lot of very similar starting values have bad performance
We seem to be having quite unusual bad performance on queries that use an index. for example the table looks like
PK BIGINT
ID VARCHAR(50)
Col1
Col2
etc
So we need to insert a row in the ...
2
votes
2answers
221 views
difference between having many non clustered index with single columns and with combination of many columns
Folks
I am a newbie to DB design stuffs. I am wondering what would be the difference and performance difference between having designed
many non clustered index with single columns and non ...
1
vote
1answer
62 views
Where does it make sense to store Indexes for partitioned tables?
Prior to table partitioning, all the indexes were stored on a separate drive, per this question. Now that I partitioned a couple of tables, SSMS is offering to store indexes in the partition scheme. ...
4
votes
1answer
341 views
How does SQL Server choose an index key for a foreign key reference?
I am working with a legacy database that was imported from MS Access. There are about twenty tables with non-clustered, unique primary keys that were created during the MS Access > SQL Server upgrade. ...
3
votes
2answers
860 views
SQL Server 2008R2 - Why is my index not used
I have a table defined in the following way:
CREATE TABLE [dbo].[MyTable]
(
[MyTable_ID] [int] IDENTITY(1,1) NOT NULL,
[COLUMN_WITH_DATA] [varchar](128) NOT NULL,
[COLUMN_A] [varchar](128) ...
3
votes
2answers
162 views
What is the signifigance of a fillfactor of 20?
I have a database for our ticket system in SQL Server express. I was poking around and noticed that a lot of the indexes have a fillfactor set to 20. What is the signifigance of it being set to 20? ...
9
votes
1answer
306 views
Behavior of data in indexes based on fill factor
Let's say you have a database where the default fill factor is 20. Whenever data is inserted, does it only create pages filled up to 20%?
From my understanding, when the data is inserted there ...
6
votes
2answers
573 views
Reindex Task Failing Randomly
We use the built-in maintenance plan to reindex (and backup, etc.) our production SQL Server. The problem we are currently having is the reindex task started failing randomly this week after months ...
4
votes
2answers
197 views
Computed column with less size than the “referring column”
I have a column with data type nvarchar(max) and I wold like to index this. However, since it's too big it's not possible. So I figured I could create a persisted computed column based on that column ...
1
vote
2answers
87 views
Is it possible to have indexes for like '%*%' type queries
Now for my thesis project i need to make a lot of queries like the below
select * from tblMyTable where ItemName like '%item%'
Now my question : is that possible to create indexes for such queries ...
14
votes
3answers
1k views
Painless way to create a clustered index on a huge table?
So we have a customer site that is complaining about some seriously slow performance. I took one look and it's obvious that the problem is because Somebody Else (grrrr) designed a table holding some ...
2
votes
2answers
563 views
Can I add “Included Columns” to an index without affecting performance?
I have a non-clustered index with 63 Million leaf level rows. Currently it does not have any included columns. I would like to add one included column while the site is online. Will this significantly ...
2
votes
1answer
598 views
How long will an index take to create?
I have a table with over 70 million rows in and I have viewed the execution plan which has identified a missing index. I took a snapshot of data a short while ago and created this index on a local ...
2
votes
1answer
248 views
Creation of spatial index locks the table for hours
I used this code to create a spatial index in SQL Server 2008 R2:
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ...
2
votes
2answers
159 views
Rebuilding Index - sort in temp db
What is the significance of SORT_IN_TEMPDB when working with indexes on a table of significant size (20GB plus)?
Where else does sorting take place?
4
votes
1answer
893 views
SQL Server 2008 R2 reindex job reorganise getting stuck
I am currently experiencing this job getting stuck in my nightly maintenance solution -
ALTER INDEX [PK_ThirdPartySettleCalled] ON [evo_archive].[dbo].[ThirdPartySettleCalled]
REORGANIZE WITH ...
7
votes
2answers
2k views
SQL Server 2008 - Partitioning and Clustered Indexes
So let me preface by saying I do not have total control over my db design, so a lot of the aspects of the current system cannot be changed for the purposes of this scenario.
Comments about how we ...