Re: Using DBI, better option than importing into @array



Why join the data with |:| just to later use split on it? Unless you are
severally strapped for memory, that is probably not a good thing to do.

To be quite frank, the only reason I'm doing that is because I don't
know a better way. I know that it's sloppy, but since the
selectall_arrayref is creating a dynamically named array I couldn't
figure out how to pick out the right thing later.

LIMIT is probably what I need there, though.


As a side note, it is generally better to use placeholders than to use
dbh->quote.

I didn't realize that, I was just looking at overall character size.
I'll giving the ? a shot, though.


Is there an index on the id column of $forum_posts? If not, then MySQL has
to read through all 600,000 rows, for each of the 21 topics. I'm guessing
that this will make MySQL, not Perl, the bottleneck.

No, but I don't quite understand how I can use an index to help me on
this one. I posted that question to a MySQL ng earlier today, though;
I know it's not really appropriate for CLPM.

Thanks for the tips.

.



Relevant Pages

  • Re: MySQL crashes on amd64
    ... >>1) Exchanging memory on the machine did not work. ... This is obviously not a hardware issue. ... The errors are reproducable for MySQL 4.1.15 and MySQL 5.0.15 so ... It is possible that mysqld could use up to ...
    (freebsd-current)
  • Re: MySQL crashes on amd64
    ... >>1) Exchanging memory on the machine did not work. ... This is obviously not a hardware issue. ... The errors are reproducable for MySQL 4.1.15 and MySQL 5.0.15 so ... It is possible that mysqld could use up to ...
    (freebsd-questions)
  • Re: MySQL/PHP: Check data length before INSERT?
    ... >> MySQL should cut it for you, if it is too long to fit, but of course ... >> never know if there is a bug in MySQL. ... buffer overrun is where you allocate a block of memory of fixed size, ... in PHP, this is not anything that you as a user of PHP need to be concerned ...
    (comp.lang.php)
  • Re: INSERT statements not INSERTING when using mysql from python
    ... One partial explanation might be that for some reason it is recreating ... a PSP script that makes many calls to populate a database. ... Then I execute many insert statements in various different loops on ... It occured to me that if I could access the mysql query log that might ...
    (comp.lang.python)
  • Memory reporting 2.4.20-xx.x, RedHat 9
    ... but now I believe it is more Linux kernel ... some FAQs I see sometimes broken or extremely delayed memory reporting ... I had this problem with MySQL database: ...
    (comp.os.linux.development.system)