SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sql Server doesn't use the right index


Sql Server doesn't use the right index

Author
Message
dazzim72
dazzim72
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 9
Hi everybody,

Some news......

I have an other index on the table prod_starts:

CREATE NONCLUSTERED INDEX [FK_prod_starts_fitgrp_id] ON [dbo].[prod_starts]
(
[fitgrp_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

This morning I discovered the select is using this. I try to disable this index and it works well, with the right index and very speed.

I don't understand why Sql Server chooses that index.
I'll wait for a week with the index disabled, I hope it changes its statistics and fixes the situation

By Marco
John Mitchell-245523
John Mitchell-245523
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14116 Visits: 15954
dazzim72 (6/26/2013)
I use the function because I have a large amount of .sql files and I prefer to store specific logic in only one point. They help me to have a simpler maintenance.

For the moment I never have had performances issue with my function.

Marco

Yes, performance problems can come on suddenly. A slight change in data can result in a totally different execution plan, and bang! You should consider converting your functions to table-valued functions.

John
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search