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 |
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2003-03-18 : 10:45:42
|
| Hi folks,I have a query which does a SELECT columns(a,b,c...) fromFROM dbo.tblCallCenterXref x INNER JOIN tblCenterHierarchyWithIDs h ON x.call_center_id = h.call_center_id INNER JOIN parent_business_group e ON x.business_group_id = e.business_group_idINNER JOIN tbl_agents_daily a ON h.agent_logon_id = a.agent_logon_id AND x.ip_id = a.ip_id call_center_id clustered indexbusiness_group_id non-clustered indexip_id non-clustered indexThere are indexes on the columns which are joined. I get a huge Scan count 5425, logical reads 11214 on the table tblCallCenterXref. Why would this be? This table has only 89 rows.Ramdas NarayananSQL Server DBA |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-03-18 : 11:16:13
|
| Do you have indexes on both tables?How many rows in each table?If tblCallCenterXref only has 89 rows, I belive it will be scanned. More likely the huge scans are from the other tables (leading me to belive that they don't have indexes on the join columns).Brett8-) |
 |
|
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2003-03-18 : 19:49:21
|
| tblCenterHierarchyWithIDs parent_business_group tbl_agents_daily All of the above tables have lots of rows over 10,0000, the join columns are indexed as well.Any thoughts.Ramdas NarayananSQL Server DBA |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-03-20 : 11:30:54
|
| I would imagine the optimizer would do an index seek. You have indexes on:Table: tblCallCenterXref, 1 each for (although for 98 rows you won't need them now):call_center_id business_group_idip_id Table: tblCenterHierarchyWithIDscall_center_idagent_logon_idTable: parent_business_groupbusiness_group_id Table: tbl_agents_dailyagent_logon_idip_idIf you do and it's still scann tens of thousands of rows, maybe you can force the index.Brett8-) |
 |
|
|
|
|
|