In this assignment, you need to demonstrate that indexes help database queries. You will use the
Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
pgbench (Links to an external site.)
command. Complete each of these tasks:
Create a somewhat large initial benchmark database with the “-i” option and “-s” (scale) option. Run the standard benchmarks (with many transactions, much more than the default 10) and record the times.
Do the same experiment as above except this time, create the benchmark database with the “–foreign-keys” option.
Do the same experiment as above in step (1) but drop all the indexes in the benchmark database before running the experiment. Also have no foreign keys.
Create a bar chart (in Excel or another program, not by hand) with the three average times you got from steps 1-3. Label the axes.
Now, use pgbench’s “-f” option to use your own queries. Create three queries that use the cinf201_stackexchange_cs or cinf201_stackexchange_cs_noindex databases. Make sure your query on the first database is fast but the same query on the second database is slow (because it has no indexes). Your queries should not be the same as anyone else’s – there are lots of tables to work with, so they shouldn’t even be very similar to another person’s. Your query file should be a SQL file that starts with BEGIN; and ends with END; and has regular queries between. Record the average times of your queries.
Create another bar chart from the results of step (5).
Turn in your highest-quality paper
Get a qualified writer to help you with
“ TU Demonstrate that Indexes Help Initial Database Queries Question ”
Get high-quality paper
Guarantee! All work is written by expert writers!