Hi,

On Tue, 2002-03-19 at 16:24, Chuck "PUP" Payne wrote:
> Ok, but that still doesn't any why MySQL is filling the delete slot, I
> understand that I can do any SQL statement to put into the order I want. I
> guess what I am trying to wonder how it place a record into the table, does
> MySQL see that the slot is empty and then fills it with a new record?

Yes.
According to the SQL specs, the order of the result set is undefined.
If you want it ordered, you have to specify it (ORDER BY).

The fact that it often looks ordered until you delete/insert is pure
coincidence and should not be relied upon. It depends entirely on the
storage mechanism used, something which is no business of the
application.

Just do an ORDER BY if you need it ordered. The server is bright enough
not to order if it is not required, or use an index to order if
possible. Trust the optimiser, and don't assume anything about ordering.


Regards,
Arjen.

-- 
Get MySQL Training Worldwide, http://www.mysql.com/training/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Arjen G. Lentz <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Technical Writer, Trainer
/_/  /_/\_, /___/\___\_\___/   Brisbane, QLD Australia
       <___/   www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to