Do ADO.Net DataTables have indexes?

前端 未结 11 2123
别那么骄傲
别那么骄傲 2021-01-01 15:11

I am using VSTS 2008 + C# + .Net 3.5 + SQL Server 2008 + ADO.Net. If I load a table from a database by using a DataTable of ADO.Net, and in the database table, I defined a c

11条回答
  •  执念已碎
    2021-01-01 15:22

    John above is correct. DataTables are disconnected in memory structures. They do not map to the physical implementation of the database.

    The indexes on disk are used to speed up lookups because you don't have all the rows. If you have to load every row and scan them it is slow, so an index makes sense. In a DataTable you already have all the rows, so a comparison is fast already.

提交回复
热议问题