Archive for December, 2006

December 20th 2006

Marco Tabini: 5 PHP Performance Tips You Probably Don’t Want To Hear

From Marco Tabini’s blog, also available in the Dec. issue of php|architect

Search the Internet—Google or no Google—and you’ll find a number of “top five lists” of tips to improve the performance of your code. Most of these lists promise you the developer’s version of all gain and no pain: performance increases without the need for any changes to your code. Some of the suggestions are too good to be true, some are just plain wrong, and some will yield some modest form of performance increase.

Installing an opcode cache, however, is not going to save you from the depths of Hell when you’re trying to run a complex select statement over a table with ten million records and no indices, however. With all these “get performing quick” articles floating around the Web, I thought it might be interesting to write an article about the performance-enhancing tips you probably don’t want to hear about—that is, those that are most likely to produce measurable (and durable) results but do require some effort on your part.

Go to Marco’s blog to read the tips

No Comments yet »

December 13th 2006

Vertical MySQL Result Output

Ever had the results of a mysql query explode all over your terminal window like this:

mysql> select * from agtAgents limit 1;
+---------+------------+---------------+-----------+-------+-
--------+-------------+
| agentID | divisionID | corporationID | stationID | level |
quality | agentTypeID |
+---------+------------+---------------+-----------+-------+-
--------+-------------+
| 3008416 |        13 |      1000002 |  60000004 |    1 |
-18 |          2 |
+---------+------------+---------------+-----------+-------+-
--------+-------------+
1 row in set (0.00 sec)

That’s not the easiest thing in the world to read, much less make sense of. To make the output a little easier on the eyes, try ending your query with a \G:

mysql> select * from agtAgents limit 1 \G
*************************** 1. row ***************************
      agentID: 3008416
  divisionID: 13
corporationID: 1000002
    stationID: 60000004
        level: 1
      quality: -18
  agentTypeID: 2
1 row in set (0.00 sec)

No Comments yet »