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 |
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-02-20 : 06:00:31
|
| Is there any way to find out indexing on system tables like sys.tables or sys.objectsVabhav T |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-20 : 06:07:33
|
| whats the need for that?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-20 : 06:21:40
|
quote: Originally posted by vaibhavktiwari83 Is there any way to find out indexing on system tables like sys.tables or sys.objectsVabhav T
They are System views. I dont think indexes are defined for themMadhivananFailing to plan is Planning to fail |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-02-20 : 06:32:19
|
| Actually if i am looking some data then i want to know how they are physically sortedVabhav T |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-02-20 : 06:46:38
|
| " physically sorted"In a relational database they have no concept of physical order. They only get an order if you add an ORDER BY clause to your Select statement. |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-02-20 : 06:56:45
|
| that means they store the data as it arrivesVabhav T |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-20 : 07:36:00
|
quote: Originally posted by vaibhavktiwari83 that means they store the data as it arrivesVabhav T
No. It depends. Dont assume anything. If you want data in particular order use ORDER BY clause explicitelyMadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-02-20 : 08:03:37
|
| "that means they store the data as it arrives"No ... it may fill in an existing spare space, or if multiple rows are bulk-loaded it be pre-sorted into a different order (to better suit the database storage), or it may be stored by two parallel tasks, and thus split, or ... a whole variety of causes.I repeat: a relational database has no defined physical order.You can type "SELECT * FROM MyTable" and if MyTable has a clustered index (most tables do) then you will USUALLY get the rows in that order. But not always. It depends what is currently in memory cache, what other parallel tasks are going on, etc.So do NOT assume that your data has any specific order ... unless you use ORDER BY in your Select. |
 |
|
|
|
|
|