"Doug" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thank you Igor.  The GROUP BY was the secret (I was trying to do a
> GROUP BY on the outer select, but it wasn't quite cutting it).
>
> GROUP BY is very powerful, but I notice it has a performance cost.
> Is there a way to use an index with it?  I have EventTime indexed and
> that index is being used.  I suppose creating a combined index of
> EventTime, ProcessID and FileName might help because the underlying
> record wouldn't need to be looked up.  Any thoughts on that idea?

No, I don't see how such an index would help. Since EventTime is the 
first component, this index can't be used to enumerate rows in the order 
defined by (ProcessID, FileName) pair. Imagine two records with the same 
ProcessID and FileName but with EventTimes that are far apart. Such 
records won't be adjacent in your index.

You could create an index on (ProcessID, FileName). But SQLite can only 
use one index in a single query. You should test and measure which of 
the two indexes results in better performance.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to