Does a clustered index in a foreign key column increase connection efficiency and is not clustered?

In many places, it is recommended that clustered indexes be better used when used to select a range of rows using the BETWEEN operator. When I choose to join over a foreign key field so that this clustered index is used, I think that clustering should also help, because the range of rows is selected even if they all have the same cluster key value and BETWEEN is not used.

Given that I only care about what you select with join and nothing else, am I mistaken in my assumptions?

+5
source share
5 answers

A discussion of this type of problem in the absolute is not very helpful.

It is always in each case!

Essentially, access using a clustered index saves one indirect period.

Assuming that the key used in the JOIN refers to the clustered index, in one read [it does not matter whether it is an index search or a scan or partial scan], you get the whole row (record).

, . . , - - INSERT ( ..)

, , , , . , . , , , .
, , , , , , INSERT ( DELETE UPDATE).

, , " " , , . FK - , , () .

,

  • , ( ) (, BTW, SQL)
  • () :
    , , / , ..
  • , ()/

[ ], .

+7

FK JOIN, : , () , B-.

, vs . .

+2

- : , JOIN? , , , ..... !

. ! . . Kim Tripp excellent . :

  • static ( )
  • : -

INT IDENTITY - GUID . . GUID .

?. ( , ). VARCHAR (200) ....

? . - - , SQL Server . . , SQL Server 4- . !

, . , , , , . - !

, . : () ! 10 , 100 000 - . , 4- , 200- VARCHAR-HUGE. - . , !

SQL Server - . - , SQL Server .

:

  • - - !
  • . , , FK ? .
+2

.

SQL Server , , B- . , , , , - , .

- , .

.

, - "" . WHERE , . . .

+1

, . , () .

0

All Articles