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
 Other Forums
 Other Topics
 joins

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-09-06 : 09:46:21
sanjay writes "i am given two tables and i jhave to join them
to optimise this what should i do

1)the tables should be on same logical disk
2)tables shold be on same physical disk
3)they shold be on different physical disk
4)the table shold be on different logical disk

i would like to know the correct answer with reason.
this question was asked in interview test

Thanks"

chadmat
The Chadinator

1974 Posts

Posted - 2002-09-06 : 13:24:27
Well,

What really helps performance is # of spindles. So I would say the clustered indexes (If the exist) should be on different physical disks.

-Chad

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2002-09-07 : 11:02:53
Hardware not my strong point but:

Don't think logical disks will make any difference.
Depends on the query but the location of the indexes may end up more important than the data.
Different physical disks may allow fater reads as can be read in parallel.
Probably should be on different controllers too.
If you have a raid system striped across disks then you can probably ignore disks.

If both tables (or covering indexes for the query) are read with single read (i.e. small and physically consecutive) then I would guess that the same physical disk would be best.

So - fastest single disk but that depends on thetables and is probably not the answer they are looking for - I would go for 3 with reservations.

Fastest really would be to have all the necessary data in memory before the query runs - and systems should be designed with that in mind.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nr on 09/07/2002 11:04:44
Go to Top of Page
   

- Advertisement -