Thorsten Schuett wrote:
have I missed something obvious or is my explanation that bad?
Your original posting was lengthy and dense. I doubt many people took
the time to read it.
Can I make sqlite use a more complex index for the joins? E.g.:
foreach row_type in type where row_type.mdc_value="MDC_HFN"
foreach row_parent in parent where row_parent.mdc_value="/tmp/file-test"
and row_parent.mdc_oid = row_type.mdc_oid
[...]
So that the if-statements are converted into index-lookups?
Create indices as follows:
CREATE INDEX idx1 ON type(mdc_value);
CREATE INDEX idx2 ON parent(mdc_value, mdc_oid);
The second index could also be this:
CREATE INDEX idx2 ON parent(mdc_oid, mdc_value);\
See http://www.sqlite.org/php2004/page-001.html and
especially http://www.sqlite.org/php2004/page-058.html
and the surrounding pages.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565