Doug <[EMAIL PROTECTED]> wrote:
I'm not an SQL guru by any means, so seeing this made a light go on.
Does
that mean it is a good idea in the general case to always add "limit
1" to a
select that you know should only return 1 row?

That probably can't hurt (if you are sure the query would only ever return one row, of course). For many queries it would be redundant and won't improve the time at all, but I can't think of any way it could make it slower.

I'm assuming this
works
because the engine can short-cut out as soon as it finds that first
matching
row.

Correct.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to