Resort (reorder) table data
- by Dave Jarvis
What is the fastest way to reorder (resort) a table? In MySQL, you can do:
CREATE TABLE table2 LIKE table1;
INSERT INTO table2
SELECT * FROM table1 ORDER BY by name;
DROP TABLE table1;
RENAME TABLE table2 TO table1;
What about PostgreSQL?
Is there a faster way?