Re: how to make multiple sql run faster
| From: | Chris | Date: | Sun, 22 Mar 2009 21:55:43 +0000 |
| Subject: | Re: how to make multiple sql run faster | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290548@lists.php.net to get a copy of this message | ||
Davi Vidal wrote:
On 03/21/2009 10:19 AM, Andrea Giammarchi wrote:That's the right syntax. Are you using mysql? Are you using innodb tables? If you're using mysql but not innodb, then no point doing this since myisam is non-transactional. What's the actual query you're running? You shouldn't need to use a union for a straight insert. An insert-into-select query could use a union, but then how fast is the select statement by itself (without the insert) ? -- Postgresql & php tutorials http://www.designmagick.com/Hi all, I am inserting more than 5000 rows into sql database but its taking more than 30 mins to get it all the data inserted. I use union to insert multiple rows of 20 at a time. What is the best way to make insert sql statement run fasterUsually a single transaction is faster than an insert a time (with or without union)What do you mean?START TRANSACTION; INSERT; INSERT; INSERT; COMMIT;