Henshall, Stuart - WCP wrote:
>
> AND invoice_li.invoice_id=sq_inv_li.invoice_id
> is the bit that tells it to check the id of the sub query and parent are
> the same.
> If you don't have this bit I believe it makes the subquery kind of
> piontless
You are right. I had "ordered" my data set in between running the
queries. When I added some new data running the EXISTS query without the
AND a.id=b.id bit the results were fast *and* wrong ;)
I'm still scratching my head as to why EXISTS isn't faster *and* why
EXPLAIN says it should be ...
Jc