Hi all, this may seem like a dumb question, but I am trying to understand
the concepts and benefits of indexes. Lets say I have a table with about a
dozen indexes defined on different columns. When I execute a query how does
the system determine which index to use? What if it uses the wrong one? I
typically add indexed by looking at my queries and then look at the columns
involved in the WHERE clause and then add a multi-column index for all the
columns involved. Is this the recommended approach?
TIA!The query optimizer chooses an 'execution plan'. To see exactly how your
execution plan is compiled, run your query in Query Analyzer using the
Query.. Show Execution Plan.. option.
<param@.community.nospam> wrote in message
news:u0eYRVq%23FHA.360@.TK2MSFTNGP09.phx.gbl...
> Hi all, this may seem like a dumb question, but I am trying to understand
> the concepts and benefits of indexes. Lets say I have a table with about a
> dozen indexes defined on different columns. When I execute a query how
> does the system determine which index to use? What if it uses the wrong
> one? I typically add indexed by looking at my queries and then look at the
> columns involved in the WHERE clause and then add a multi-column index for
> all the columns involved. Is this the recommended approach?
> TIA!
>|||http://www.aspfaq.com/show.asp?id=2231
"param@.community.nospam" wrote:
> Hi all, this may seem like a dumb question, but I am trying to understand
> the concepts and benefits of indexes. Lets say I have a table with about a
> dozen indexes defined on different columns. When I execute a query how doe
s
> the system determine which index to use? What if it uses the wrong one? I
> typically add indexed by looking at my queries and then look at the column
s
> involved in the WHERE clause and then add a multi-column index for all the
> columns involved. Is this the recommended approach?
> TIA!
>
>|||Great article. Is a Primary Key automatically an Index?
TIA!
"KH" <KH@.discussions.microsoft.com> wrote in message
news:15BA507C-8BF7-4100-9A94-718D9429ADAB@.microsoft.com...
> http://www.aspfaq.com/show.asp?id=2231
>
> "param@.community.nospam" wrote:
>|||Hello,
When you specify a PRIMARY KEY constraint for a table, Microsoft SQL Server
2000 enforces data uniqueness by creating a unique index for the primary
key columns. This index also permits fast access to data when the primary
key is used in queries.
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: <param@.community.nospam>
>References: <u0eYRVq#FHA.360@.TK2MSFTNGP09.phx.gbl>
<15BA507C-8BF7-4100-9A94-718D9429ADAB@.microsoft.com>
>Subject: Re: index question
>Date: Wed, 7 Dec 2005 09:33:45 -0600
>Lines: 30
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
>X-RFC2646: Format=Flowed; Original
>Message-ID: <eI7edO0#FHA.272@.tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.programming
>NNTP-Posting-Host: corp.lazardgroup.com 69.2.40.60
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:566890
>X-Tomcat-NG: microsoft.public.sqlserver.programming
>Great article. Is a Primary Key automatically an Index?
>TIA!
>"KH" <KH@.discussions.microsoft.com> wrote in message
>news:15BA507C-8BF7-4100-9A94-718D9429ADAB@.microsoft.com...
understand
about
I
>
>
No comments:
Post a Comment