The PDC ended yesterday but true to form I didn't blog the sessions last night but insead am doing it a day late. I heard that an article I wrote on the "language wars" was posted on Comnet at http://commnet.microsoftpdc.com/pdcreflections.aspx. I am not sure if you had to register to see this article or not. I will check that out and post it here later if there is a problem getting to it. I only took notes on 1 session that I attended so here they are:
DAT408-ADO.NET: Advanced Data Access Patterns
Getting data wiht a DataReader is fast, going back to the server is slower but UpdateBatchSize helps. If the provider supports it parameters will be sent in an array.
Going from the client to the server - Bulk insert to a temporary table then use DML to move the rose (one statement/type) and do it all in a single transaction.
Grouping lots of data operations in a transaction can be faster because there will be less writing of the transaction log to the disk.
Must load data into a DataTable to do batch updating.
For BulkCopy to go fast the database needs to be in simple or bulk-logged recovery mode. Tempdb is already in simple mode.
To speed it up further you can implement a custom data reader to read the data and stream it rather than reading into a DataTable (DataTable puts all rows in memory at once).
Use SqlDependency to notify of changes to the data and invalidate the cache. Use a DataSet to store the data in cache and invalidate the DataTables as needed.
SqlDependency doesn't have any granualarity control so to make it more efficient load data in chunks, when a cache miss occurs. On a notification, just delete the chunk so the rest of the chunks in the cache aren't invalidated. In the callback for the notification delete the rows from the DataTable.
If you use a DataSet for a cache you wll need to query the data in it. Joins are missing. You get the ability to filter rows now.
To create an "index" on a datatable call select for a temporary one or create a DataView for a permanent "index".
Pablo will post the code to do joins in a DataSet to the blog at blogs.msdn.com/dataaccess.
It was a fun week at PDC. I really enjoyed being there to hear about all the new technologies. I got enough DVDs to keep me busy for a long time looking at new stuff. The only real bummer was that sometime Friday afternoon I lost my cell phone. The security guys at the convention center found it and are supposed to be sending it to me but for a few days I will be without it.