random1 Posted November 17, 2011 Share Posted November 17, 2011 My Data Table: CREATE TABLE IF NOT EXISTS `file_type` ( `filetype_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'The ID of the file type', `filetype_extension` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The extension of the file type', `filetype_name` varchar(300) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The name of the file type', `filetype_description` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The Description of the file type', PRIMARY KEY (`filetype_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; REPLACE INTO `file_type` (`filetype_id`, `filetype_extension`, `filetype_name`, `filetype_description`) VALUES (1, 'jpg', 'Joint Photographic Experts Group', 'A compression technique for color images that can reduce files sizes to about 5% of their normal size. Some detail is lost in the compression.'), (2, 'zip', 'ZIP Archive', 'An open standard for compression and decompression used widely for PC download archives, ZIP was developed by Phil Katz for his DOS-based program PKZip, and it is is now widely used on Windows-based programs such as WinZip and Drag and Zip.'), (3, 'pdf', 'Portable Document Format', 'A document-encoding process developed by Adobe that maintains page layout, fonts, and graphics.'), (4, 'exe', 'Executable', 'A program file in the Windows environment.'), (5, '7z', '7-Zip Archive', 'A highly compressed archive that contains files. Commonly used for backups and archiving.'); I'd like to convert the ordering of the table from: to: (i.e. Reordering the table alphabetically by the 'filename_extension' column) By this I don't mean ORDER BY in a SELECT statement, but I mean reordering the records themselves. Any ideas? (The table I'm showing here is just an example, the table I really want to order has over 15000 records) Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 17, 2011 Share Posted November 17, 2011 Why would you want to do that? It really doesn't make any sense to. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 17, 2011 Share Posted November 17, 2011 from what I am aware of, is that if you think there will be better performance, you are wrong (maybe I am but I don't think that will improve permormance). Quote Link to comment Share on other sites More sharing options...
fenway Posted November 18, 2011 Share Posted November 18, 2011 You almost never need to physically reordering the records -- you're not supposed to even know how they're being stored. There are rare circumstances for historical tables which are huge where this matters -- like 0.01% of the time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.