Procedure Analyse in MySQL to Check Types

by Nicolas Ruflin, Montag, 6. Juli 2009

In MySQL there is command "procedure analyse". It can be used to find out if you're using the right types in a table. As an example you can call: SELECT * FROM user procedure analyse() It will output the types you use, min-max value and min-max length and some more information. This could give you some advices which file types you should check.

More detailed informations you'll find in the MySQL Performance Blog.

Read more ...

Website speed optimieren

by Nicolas Ruflin, Freitag, 5. Juni 2009

Almost for every webpage it's essential to improve the loading speed because this is one important part of the user experience. A lot of people today have broadband so loading big images or JavaScript files seems to be less a problem. But keep in mind that still all around the world people are surfing with 56KBit/s and nowadays more and more people are accessing the internet over there mobile phone with EDGE or 3G.

There exist some nice tools to get a report about you're webpage speed and what you could optimize.

This two tools are very similar. Yahoo also offers a very extensive list of "Best Practices for Speeding Up Your Web Site". There are a lot of small improvements that are also worth to implement on small webpages. But for some it's necessary to change the server configuration or to work with subdomains.

Read more ...

Coding Guidelines in SQL Queries Important for Query Cache

by Nicolas Ruflin, Donnerstag, 4. Juni 2009

It's important to also use coding guidelines in your SQL queries you write for example inside your PHP Code. Most MySQL SELECT queries are cached and since MySQL 5.1.17 also prepared statements are cache (with some exceptions).

For SQL query caching to work it's important that a query is exactly the same (Byte by Byte) as the one before. As an example the following three queries are all different for the query cache even if they return exactly the same result: SELECT * FROM tbl_name Select * From tbl_name SELECT * FROM tbl_name In the last example we have some more spaces. So be careful when you write your SQL queries.

Read more ...

Bei Zend Translate Adaptern 1.8 wurde Caching-Rückgabewert hinzugefügt

by Nicolas Ruflin, Donnerstag, 28. Mai 2009

Ich verwende meine eigenen Zend Translate Adapter für eine MySQL Datenbank. Heute habe ich das Update auf Zend Framework 1.8.2 gemacht. Das Ganze verlief mehr oder weniger reibungslos; ich musste nur einige Änderungen machen. Ein Problem war allerdings geblieben: Sobald ich das Caching aktivierte, funktionierten meine Übersetzungen nicht mehr. Es wurde nur die Originalsprache angezeigt.

Also versuchte ich herauszufinden, was sich bei den Translate Adaptern zwischen 1.7 und 1.8 geändert hat. Der Unterschied sieht folgendermassen aus: $this->_translate[$locale] = $data + $this->_translate[$locale]; In Version 1.8 wurde ein Rückgabewert hinzugefügt und die Variablen umbenannt: $this->_data[$locale] = $data + $this->_data[$locale]; return $this->_data;

Anscheinend spielt es keine Rolle, dass der Name von _translation nach _data geändert wurde. Man muss jedoch beim eigenen Translation Adapter ein return hinzufügen, damit das Caching auch in ZF 1.8 funktioniert. Ansonsten bleibt der Cache leer und es wird nur die Originalsprache angezeigt.

Read more ...

Using Google CDN to Load jQuery

by Nicolas Ruflin, Freitag, 10. April 2009

Google offers the possiblity to link some JavaScript libraries like jQuery directly over Google CDN. But what is the advantage of loading it directly from then loading it from the own server? There are at least 3 advantages:

  • Saving bandwith
  • Allows you to download script in parallel
  • Chance that the file is already in the cache is higher. Also other sides use this file.

Read more ...