Re: Optimizing Queries (specifically with LIMIT)

2004-05-30 Thread Daniel Clark
I found it interesting. Thanks Eric. >>(reconstructed from archives i accidentally deleted the copy in my mailbox >>>Daniel Clark writes: >>>I don't see how LIMIT would make a difference. LAST_INSERT_ID() only >>>returns one record. >>>But it's worth trying in a big loop to get timing numbers

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Eric Absgarten
(reconstructed from archives i accidentally deleted the copy in my mailbox Daniel Clark writes: I don't see how LIMIT would make a difference. LAST_INSERT_ID() only returns one record. But it's worth trying in a big loop to get timing numbers. Well, I decided to test this all out and see what ha

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Daniel Clark
I don't see how LIMIT would make a difference. LAST_INSERT_ID() only returns one record. But it's worth trying in a big loop to get timing numbers. >>I have a rather simple straightforward question that I was not able to find >>in any of the documentation. >>I am in the process of writing an

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Michael Stassen
LAST_INSERT_ID is connection-specific, not table-specific. When you say, SELECT LAST_INSERT_ID() FROM foo; you are asking for the LAST_INSERT_ID to be repeated once for each row of table foo. This is analogous to SELECT NOW() FROM foo; or SELECT 2 FROM foo; Adding a LIMIT would work, but

Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Eric Absgarten
Hello, I have a rather simple straightforward question that I was not able to find in any of the documentation. I am in the process of writing an application, and I was wonder whether there is any benefit (or penalty) in LIMIT(ing) a LAST_INSERT_ID() query? i.e. SELECT LAST_INSERT_ID() FROM foo