I'm porting some code from perl to php, and have experienced a tremedous
slowdown in one particular query, and I'm perplexed as to why.   The query
is simply "Select * From my_table order by ID desc LIMIT 0,20", to get the
last 20 records that were entered.  ID is the Primary Key, and it is
auto-incremented.

The "Order by" is clearly where the slow-down is -- both scripts are very
fast without it.

I would expect the php version to be faster, because it's compiled into
apache, and perl is being run as a CGI script.  Regardless, I'm not timing
the whole script, just the time it takes to execute the query.  It takes
several seconds in PHP.

Does anyone have any insights as to why?  I thought the problem was related
to MyISAM (before I realized it was fast in perl), so I've been upgrading
the tables (btw, thanks to those that answered my question as to how).

I'm using mysql_pconnect to connect to the database in PHP, and using the
DBI module to connect in perl.

Ideas?  I know this sounds very bizarre -- I've been playing around with it
for hours, trying to figure out how PHP could possible be tied to slowing
MySQL down.

TIA,

Tac



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to