0

is it right?:

When a clustered index and a non-clustered index coexist, if one or more records are located through the non-clustered index, the content of the record will contain the key of the record in the clustered index, and the database uses this key to locate the record in clustered index, this time the record contains real content of the record.

But if there is no clustered index and only one or more non-clustered index, when one or more records are located using the non-clustered index, what will be the content of the record? Is the real content recorded? Or disk address where the real content of the record is stored? If a data insertion occured, causing the real storage address of the record content to change, then multiple non-clustered indexes will be updated at the same time? And just becasue of that, it (there is no clustered index and only one or more non-clustered index) will take up a lot of storage space, so modern popular relational databases will always ensure that data tables have a clustered index?

Thanks a lot.

fdadftl
  • 3
  • 3
  • try to add some examples to help us to understand the problem you are facing that will be easier to help with. – sagar Aug 16 '20 at 07:23
  • A clustered index will only be created if you instruct the database to create one. – Bob Jarvis - Слава Україні Aug 16 '20 at 16:18
  • Your actual question seems to be: "How do tables without a clustered index work technically?". And you should probably ask this (e.g. explaining how you think that clustered tables work, and the technical problems you see when there is none), instead of assuming (in the title) that there actually are deep technical problems that will make developers want to enforce clustering. In fact, databases have no trouble with that. Those structures are called [heaps](https://stackoverflow.com/q/1341393), and maybe reading about those may clear things up (or allow you to make your question more precise). – Solarflare Aug 16 '20 at 16:32

0 Answers0