On 12 Feb 2016, at 8:47am, Michele Pradella <michele.pradella at selea.com> 
wrote:

> Hi all, is there a way to make a benchmark of queries to check which version 
> is faster? I'm using sqlite shell, the question is about on how to make 
> repetitive tests in the same conditions (for example I need to totally 
> disable cache to avoid different results the second time query is executed).

Using the ".timer ON" command in the command-line shell, as you write, is the 
best way to do timing.  But there are many levels of cache in your computer and 
there's no way to disable them all.  You will definitely get timings influenced 
by interactions.  

It looks like you are trying to make commands run as fast as possible.  Unless 
you are writing an academic paper on theory, this is probably the wrong thing 
to do.  Write your software and see if it runs fast enough.  Only if it runs 
too slowly do you need to start worrying about speed.

We can advise on good SQL commands and good indexes for you if you do need to 
increase your speed.

Simon.

Reply via email to