ComponentOne LiveLinq > Samples > Getting Started Samples > HowTo Samples > Indexing samples |
HowTo Indexing samples demonstrate basic use of the first of the two areas of LiveLinq functionality: using indexes to make LINQ queries faster. They don’t use live views, except for LiveLinqToXml, where live views are necessary to define base data collections.
Every sample uses two queries: one the most basic and the other a little more complex, with a join. The queries are identical in functionality in all three samples, differing only in the nature of the underlying data: user object collections (LiveLinqToObjects), ADO.NET DataSet (LiveLinqDataSet) or XML (LiveLinqToXml).
Every sample shows two alternative ways of creating indexes: explicitly, by adding to the Indexes collection, or implicitly, by using hints in queries.
LiveLinqToObjects
This sample shows how to use the IndexedCollection class to create and query data collections using indexes to speed up query performance.
LiveLinqToDataSet
This sample shows how to use LiveLinq to query data residing in an ADO.NET DataSet, how to create indexes over that data that make querying faster than regular LINQ to DataSet queries. Both strongly typed and untyped datasets are demonstrated in the sample.
LiveLinqToXml
This sample shows how to use LiveLinq to query XML data. It creates indexes on ‘customers’ and ‘orders’ live views defined directly over XML data. This easy XML indexing allows to dramatically speed up LINQ queries over XML data, often make them hundreds of times faster than regular LINQ to XML, see Query Performance sample application (LiveLinqQueries) for performance metrics.