Linked Questions

1
vote
1answer
4k views

MySQL not using PRIMARY KEY to sort by default [duplicate]

I have a large MySQL table on 5.6.35-81.0 Percona Server with gaps in the PRIMARY key. The table has around 53 Million records and the auto-increment key is now at around 370 million. The table is a ...
1
vote
2answers
129 views

How to store table values in order [duplicate]

I created a table and inserted values into it but they are not storing in orderly manner. The table looks like: I can order them by using ORDER BY but it does not change them permanently. Is there a ...
14
votes
3answers
11k views

Why is SSMS inserting new rows at the top of a table not the bottom?

Whenever I manually insert a row into a table in SQL Server Management Studio 2008 (the database is SQL Server 2005) my new row appears at the TOP of the list rather than the bottom. I'm using ...
7
votes
4answers
1k views

Does an IOT guarantee order in a select?

We need to add a priority column to a table that gets hit about 250 times a second, approx 170 selects, 125 inserts and 60 updates. The column will be a simple number(1). The priority does not matter ...
8
votes
1answer
4k views

Storage order vs Result order

This is a spin-off question from Sort order specified in primary key, yet sorting is executed on SELECT. @Catcall says this on the subject of storage order (clustered index) and the output order A ...
-6
votes
3answers
995 views

Does “deprecated” in MySQL means “not guaranteed” or “still guaranteed”?

MySQL 3.23/4.0/4.1 and 5.1 states: If you use GROUP BY [ for select ], output rows are sorted according to the GROUP BY columns as if you had an ORDER BY for the same columns. ➫➫➫ However, MySQL 5....
2
votes
1answer
760 views

weird sql server behavior when inserting and selecting

Today after one of the drives on our sql server ran out of space. The drive contained eventracker logs, so I didn't think it was a big deal, but then I noticed when I insert a record into a database, ...
2
votes
1answer
419 views

What is the order when SELECT-ing unordered set from an ordered SELECT?

What does the SQL standard and its mainstream DB implementations (SQL Server, Oracle, DB2, PostgreSQL, Firebird, MySQL, etc.) say about the final order in the following general case: SELECT * FROM (...
3
votes
3answers
756 views

MySQL: ORDER BY useless?

CREATE TEMPORARY TABLE tt; INSERT INTO tt; many times SELECT FROM tt ORDER BY id LIMIT ?,1000; The temp table is created at the beginning of the script having an "id" auto_increment column (and ...
1
vote
1answer
515 views

Set in mySQL a predefined order for SELECT queries without using the ORDER BY clause

I have a MySQL database and users access it through an old legacy software (OLS) the company bought years ago. OLS connects to MySQL through MySQL ODBC driver. There is no way to change OLS in recent ...