Yes, after timing both I found that SELECT EXISTS is actually a tiny bit
faster, which does matter when multiplied by thousands of executions in
a row.

Unfortunately, I still cannot get it as fast as I want - it takes
approximately 1500-2000 ms per approximately 2000-3000 executions. Is
there any way to speed this up even further somehow? The scenario is
that I have a table full of SQL statements that need to be reexecuted
often to check whether they return any results or not (from other
tables). I have all those SQL statements in memory in the application,
so that saves a bit of time, but can I do anything else?

Thanks!

   Dennis 

> -----Original Message-----
> From: Dennis Cote [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 27, 2007 12:35 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Questions on views
> 
> Dennis Volodomanov wrote:
> > Is doing a SELECT EXISTS (...) faster than a SELECT COUNT 
> (... LIMIT 
> > 1) or would it be the same (I would expect them to be the same, but 
> > that's only my guess)?
> >
> >   
> I would expect them to be very nearly the same. Any 
> difference would only be apparent if you repeat them many 
> times (which is what you are doing). You should probably try 
> it both ways and measure the execution time to see which is faster.
> 
> HTH
> Dennis Cote
> 
> --------------------------------------------------------------
> ---------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> --------------------------------------------------------------
> ---------------
> 
> 

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

Reply via email to