Re: Memory Leak?
| From: | Jasper Bryant-Greene | Date: | Sat, 22 Oct 2005 22:08:45 +0000 |
| Subject: | Re: Memory Leak? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224467@lists.php.net to get a copy of this message | ||
On Sat, 2005-10-22 at 16:36 -0500, Richard Lynch wrote:
> I've written a script to munge and import 108,000+ records.
[snip]
> http://l-i-e.com/feedbaby/memory_leak.htm
It looks fine to me, but you might like to try accumulating the records
say up to 100 at a time and then doing extended INSERTs (if your MySQL
version supports them) like this:
INSERT INTO tablename
(col1, col2)
VALUES
('value1', 'value2'),
('value3', 'value4'),
('value5', 'value6'),
('value7', 'value7')
... and so on.
These are apparently much nicer for MySQL to process, which may result
in lower memory usage and faster operation.
--
Jasper Bryant-Greene
General Manager
Album Limited
e: jasper@album.co.nz
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand