i came across this. let implement marc_s's suggestion:
create table dbo.mytable (pkguid uniqueidentifier not null, myint int identity(1,1) not null, .... add more columns needed ...... ) alter table dbo.mytable add constraint pk_mytable primary key nonclustered (pkguid) create unique clustered index cix_mytable on dbo.mytable(myint) would therefore use myint foreign key in joined tables?
ps:
i think this answers not hundred percent sure.
using clustered index foreign key should speed joins.
but can index guid column , use join, although expect little worse performance.
you must think if guid provides information (maybe aren't using random guids email addresses?), in case have other benefits use them foreign keys instead of random numbers. e.g. in queries may not need join main table filters may guid beforehand.
Comments
Post a Comment