I have a simple table in my database called 'avatars'
CREATE TABLE `avatars` (
`avatar_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`avatar_image_name` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`avatar_id`)
) ENGINE=MYISAM AUTO_INCREMENT=60 DEFAULT CHARSET=latin1
Which has some data in it.
When I run a simple select query:
LIMIT 0 , 30
What order does it follow to show the resultset? As u can see from the attached screenshot that the autoincrement id column is not in serial order.
Please explain this.
it's really simple
without an ORDER BY clause, the database engine is allowed to return rows in whatever sequence it wishes
I know but what I want to know is that does it have any internal logic at all?
it returns them in the sequence it finds them
But logically should not it find the records in the sequence it was inserted?
no, because the insertion takes place on the most readily available disc space, which could be anywhere in the sequence
Where did you find this info sir? coz I was unble to see any such info in the official document
you're gonna have an even harder time finding anything that contradicts it
This topic is now archived. It is frozen and cannot be changed in any way.