I have a simple product table that keeps track of product data. Most of the time i don't need to know what type of product it is, but every once in awhile i need the product type. Now since not all products even have a type (which results in a lot of NULL rows), i use a reference table to join the product type when i need that info. The reference table uses a composite key and what I'm trying to figure out is should the primary key be a cluster index or a non clustered index. The product table has a clustered index for its primary key, so i was wondering if the join would be more efficient if it was also a clustered index ( so that the order of the id's are in order). Or is this ignored during the join and thus the nonclustered would be more efficient since it doesn't do a key lookup?
CREATE TABLE [dbo].[sales_product_type]
(
[FK_product_id] [int] NOT NULL,
[product_type] [int] NOT NULL,
[type_description] [nvarchar](max) NULL,
CONSTRAINT [PK_sales_product_type]
PRIMARY KEY CLUSTERED ([FK_product_id] ASC, [product_type]
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[sales_product]
(
[product_id] [int] IDENTITY(1,1) NOT NULL,
[FK_store_id] [int] NOT NULL,
[price] [int] NOT NULL,
[product_name] [nvarchar](max) NOT NULL,
[units] [int] NULL,
CONSTRAINT [PK_sales_product]
PRIMARY KEY CLUSTERED ([product_id] ASC)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO