Alex Rivera | Logout

How to compare two queries?

Asked 2010-09-21T20:03:40.400
38

How can I compare two queries X and Y and say that X is better than Y, when they both take almost the same time in small cases scenarios?

The problem is that I have two queries that are supposed to run on a very big database, so run and evaluate is not quite an option. Therefore, we created a small database to perform some tests. Evaluating which query is better is a problem, since on our test base, they run in almost the same time (about 5 minutes). Besides the time taken to return, what is another way to measure how good a query is?

Edit
Report

1 Answer

0

Evaluating query performance on a significantly different data set generally makes very little sense. Query plans and their efficiency can vary greatly depending on the data stats.

So to get any realistic estimates, you need a database as close to the "real" one as possible. Best of all, take a copy of your "big database" and tune your queries to it.

answered 2010-09-21T21:13:51.387

Your Answer