Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
aaroww11
Starting Member
12 Posts |
Posted - 2012-01-31 : 12:44:39
|
I have one table with 7 million records.I have to read date from that table couple times in second from 10 concurrent threads.I need to read some record only once.The idea is that I add other table and insert id’s of records which I read.The query for the upper query would be left join between 2 tables.I would use snapshot isolation.Is this good approach? |
|
X002548
Not Just a Number
15586 Posts |
|
aaroww11
Starting Member
12 Posts |
Posted - 2012-01-31 : 13:02:09
|
For example we have CREATE TABLE table1( [ID] [int] IDENTITY(1,1) NOT NULL, [data1] [int] NOT NULL, [data2] [int] NOT NULL, [insertdate] timedate not null CONSTRAINT [PK_ table1] PRIMARY KEY CLUSTERED ( [ID] ASC)CREATE TABLE table1read( [ID] [int] IDENTITY(1,1) NOT NULL, [table1id] [int] NOT NULL, [insertdate] timedate not null CONSTRAINT [PK_ table1read] PRIMARY KEY CLUSTERED ( [ID] ASC)The select wolud be something like select top 100 * from table1 left join table1read on table1.id=table1read.table1idwhere table1id is nullAfter that I wolud insert all 100 records id’s into table1read |
 |
|
|
|
|