Thanks for suggestion. Now I can say for certain that no index is used on
Link table in query
Select ne.*
From Node AS n
JOIN Entity AS ne ON n.LOCAL_ID = ne.LOCAL_ID
JOIN Link AS l
JOIN Entity AS le ON l.LOCAL_ID = le.LOCAL_ID
Where l."Target.Id" = '06d15df5-4253-4a65-b91f-cca52da960fe'
AND l."Source.Id" = ne.Id
OR l."Target.Id" = ne.Id
AND l."Source.Id" = '06d15df5-4253-4a65-b91f-cca52da960fe'
And in
Select ne.*
From Node AS n
JOIN Entity AS ne ON n.LOCAL_ID = ne.LOCAL_ID
JOIN Link AS l
JOIN Entity AS le ON l.LOCAL_ID = le.LOCAL_ID
Where l."Target.Id" = '06d15df5-4253-4a65-b91f-cca52da960fe'
AND l."Source.Id" = ne.Id
Index for target.id is used
-----Original Message-----
From: Griggs, Donald [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 03, 2007 1:04 AM
To: [email protected]
Subject: RE: [sqlite] FW: Performance problem with complex where clause
regarding: "So it seems that indexes are not used at all, and that is
pretty strange"
There's a great feature in sqlite that lets you know for sure.
Prefix your query with:
EXPLAIN QUERY PLAN SELECT .....
And you can see just which, if any indices are used.
For a more detailed look at the internal "program" that your query will
generate, you can use simply
EXPLAIN SELECT .....
----------------------------------------------------------------------------
-
To unsubscribe, send email to [EMAIL PROTECTED]
----------------------------------------------------------------------------
-
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------