I have a table I'm using as a stack to pop rows from. (The data in the stack is precomputed for efficiency and reliability.) There are a lot of duplicate rows in this table (hundreds or thousands of identical rows), but they are all inserted with a regular insert statement.
I have optimized it by using the multiple row insert syntax:
Expand|Select|Wrap|Line Numbers
- INSERT INTO TableName (Col1, Col2) VALUES
- ("Some value", "Another value"),
- ("Some value", "Another value"),
- ("Some value", "Another value"),
- ("Some value", "Another value"),
I was thinking of mowing all this to the server insted, like this:
Expand|Select|Wrap|Line Numbers
- INSERT INTO TableName SELECT "Some Value" AS Col1, "Another value" AS Col2
Expand|Select|Wrap|Line Numbers
- INSERT INTO TableName SELECT "Some Value" AS Col1, "Another value" AS Col2 FROM AnotherTableName LIMIT n
Any ideas?
(This is all going to be running on a webserver I do not have control over. Probably a FreeBSD/Linux solution with Apache/MySQL/PHP.)