"Samuel R. Neff" <[EMAIL PROTECTED]> wrote:
> Are there any tools to help analyze the performance of
> components with a particular SQLite statement?  I'm 
> aware of the EXPLAIN option which can show what VBDE
> code was used to execute a statement, but afaik there
> is no way to tell the time each step took.
> 
> Basically I want to know how long the different 
> components of a single SQL statement took relative 
> to the whole statement.  Provide for more fine-grained 
> analysis than just comparing two SQL statements based
> on total execution time.
> 

You used to be able to compile with -DVDBE_PROFILE=1
to enable some special assembly-language instructions
that would use hi-res timers on ix586 chips to provide
the cycle counts needed to execute each instruction in
a VDBE program.  But I haven't used that feature in 
years so I don't know if it still works or not.

As a general rule of thumb, most VDBE opcodes require
about 100 processor cycles (IIRC), except for those that
do disk I/O which require around 50,000 cycles.  So
you could run with "PRAGMA vdbe_trace=ON", count the
number of VDBE opcodes executed, multiply by the
constants above, and that would give you a good
first-order approximation.

Another good rule of thumb is that COMMIT is really
slow and that everything else is really fast.  :-)

--
D. Richard Hipp <[EMAIL PROTECTED]>



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to