I was surprised to learn that LIMIT has no effect on aggregate functions like count(*). I would have expected that LIMIT would have stopped the query as soon as that number of records were found. Is this the expected behavior?
My objective was to quickly determine if any records existed that met a particular WHERE clause. I don’t really need to know how many total records there are, just that there is at least one (so there is no need to continue reading records once the first record has been found). Is there an efficient way to do this, other than using count(*)?