j***@yahoo.com
2008-08-19 07:46:34 UTC
Hi there,
Anyone have any idea if it cause performance issue to inner join 2
tables with clustered indexed column which is varbinary data type?
CREATE TABLE [dbo].[table1](
[ID] [int] IDENTITY(1,1) NOT NULL,
----//////others columns here,
[MD5Key] [varbinary](8000) NOT NULL
CONSTRAINT [PK_rptFctCpCpk_201] PRIMARY KEY CLUSTERED
(
[MD5Key] ASC,
[ID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
create table #table2(MID int, MD5Key2 varbinary(8000))
CREATE CLUSTERED INDEX [#tmpMD5Key2_IDX01] on [dbo].[#tempMD5Key2]
(MD5Key2)
Estimated there is 20 millions record in table 1 and 200k records in
temp table.
It hit performance issue during execution. May I know if it is
practical to use the varbinary column as key to join 2 tables?
The idea behind is to encode the data in MD5 format using hashbytes()
and the temp table was constructed dynamically to encode all search
criteria using hashbytes as well, the 2 tables are joined to find the
target records and output to report.
Please give advice if it is possible to use the varbinary column as
key to join two huge tables.
Many thanks!
j4m35bond
Anyone have any idea if it cause performance issue to inner join 2
tables with clustered indexed column which is varbinary data type?
CREATE TABLE [dbo].[table1](
[ID] [int] IDENTITY(1,1) NOT NULL,
----//////others columns here,
[MD5Key] [varbinary](8000) NOT NULL
CONSTRAINT [PK_rptFctCpCpk_201] PRIMARY KEY CLUSTERED
(
[MD5Key] ASC,
[ID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
create table #table2(MID int, MD5Key2 varbinary(8000))
CREATE CLUSTERED INDEX [#tmpMD5Key2_IDX01] on [dbo].[#tempMD5Key2]
(MD5Key2)
Estimated there is 20 millions record in table 1 and 200k records in
temp table.
It hit performance issue during execution. May I know if it is
practical to use the varbinary column as key to join 2 tables?
The idea behind is to encode the data in MD5 format using hashbytes()
and the temp table was constructed dynamically to encode all search
criteria using hashbytes as well, the 2 tables are joined to find the
target records and output to report.
Please give advice if it is possible to use the varbinary column as
key to join two huge tables.
Many thanks!
j4m35bond