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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Handle large table in join

Author  Topic 

prakashram
Starting Member

4 Posts

Posted - 2006-11-14 : 05:17:05
Hi Friends,

I have two large tables like auditTbl, CntTbl which has around 30 lacks records.

auditTbl - CntId, UsrId, DateAccess,

CntTbl - CntId, CntCate

i want to get number of access for each user with each content.
I have writen query but it's taking more time to execute bec of large data in both table.

How can i overcome this problem?
Please give the solution to handle this problem

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-11-14 : 05:19:22
Please post your table DDL and your query. Also indicate what are the indexes you have on these 2 tables.


KH

Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-14 : 05:24:52

Select UsrID, CntID, Count(DateAccess)
from auditTbl a Join CntTbl c
on a.CntId = c.CntId
Group by UsrID, CntID


???

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-14 : 05:51:21
Which indexes do you have on your 3 million record table?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-14 : 08:46:56
quote:
Originally posted by prakashram

Hi Friends,

I have two large tables like auditTbl, CntTbl which has around 30 lacks records.

auditTbl - CntId, UsrId, DateAccess,

CntTbl - CntId, CntCate

i want to get number of access for each user with each content.
I have writen query but it's taking more time to execute bec of large data in both table.

How can i overcome this problem?
Please give the solution to handle this problem



Post the query you used. Also post table structures

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -