Project Part #4

Performance analysis (bulk load, indexes, and views)


Indexes and views can improve the performance of frequently asked queries. Instead of only inserting several tuples into tables by hand as you did in last part,  this time you will choose one or two tables from your schema to load large number of tuples in order to make meaningful comparison of running times.

1. [10] Generate data set which contains at least 2,000 tuples (no more than 5,000) in a table you choose. Use your favorite language to generate a text file (example format: fields delimited by comma, tuples delimited by new line). Submit the source code for data generation. Show the first 10 lines, 10 lines in some middle position, and last 10 lines of the text file.

2. [15] Load into the table with the newly generated text file using the facility of underlying database system. You may want to delete all records before loading. Before and after loading, show the result of query "select count(*) from TABLE".

3. [10] Create an index for a field. Run a query containing a condition of that field. Compare the running times of the query with and without using the index.  Submit the scripts and running times. Explain why. Lastly drop the index.

4. [15] Create a view.  Run another query with and without using the view. Try to update the view and see what happens. Explain why. Lastly, drop the view.



Please refer the following links to load your SQL Server databases: Bulk Load using DTS in MSSQL
 Bulk load in MSSQL , or MS-bulkload in pdf