"D. Richard Hipp" <[EMAIL PROTECTED]> writes:

> Zahraie Ramin-p96152 wrote:
>  >
>  > select a.sourceIndex, a.dsuIP, a.dsuPort, a.sourceType, a.workIp,
>  > a.SourceName, b.fileId, b.filePath, b.startTime, b.endTime from
>  > dvrpAudioSourceTable a, dvrpAudioFileTable b, dvrpIndexTable c where
>  > b.startTime>= 100 and b.endTime <= 200 and c.fileId = b.fileId and
>  > a.sourceIndex = c.sourceIndex order by a.sourceIndex, b.fileId;
>
>
> Try this:
>
>     *  Reorder the FROM clause terms to be B, C, A instead of A, B, C.
>     *  Create index on  B.FILEID.
>     *  Create index on  A.SOURCEINDEX

Richard, is there any document that explains how to write queries to best help
the sqlite query planner generate an efficient program?  If not, might you be
able to write up some guidance?  (i.e. did you recommend that the order by B,
C, A here because B is used the most times in the FROM clause, or for some
other reason?  Why those indexes and not the ones I had recommended in a
separate message?)

Thanks!

Derrell

Reply via email to