Posts in the "Databases" Category

  • Here’s a quick tip in MySQL. Let’s say you have a table called browsercount like the one below: id browser count 1 Internet Explorer 1 2 Opera 2 Let’s say you have a web-analytic application which has to add a browser into the table if it doesn’t exist, but update the count for the browser [...]

    Read More...
  • This video is from one of Google’s Techtalk sessions by Jay Pipes ABSTRACT Learn where to best focus your attention when tuning the performance of your applications and database servers, and how to effectively find the “low hanging fruit” on the tree of bottlenecks. It’s not rocket science, but with a bit of acquired skill [...]

    Read More...
  • I’ve had to to look at this situation quite a few times on live servers, where the number of MySQL connections seemed to exceed the max limit of the server and PHP used to throw “Too many connections” error when a MySQL query was run. When we looked at the MySQL process list, it showed [...]

    Read More...
  • Here’s a cool utility for MySQL administrators which allows you to track the performance of your servers and also gives you performance enhancement tips. You can see a sample report from this tool over at: http://gert.sos.be/demo/mysqlar/ The MySQL Activity Report package is a tool to help MySQL database administrators to collect several database parameters and [...]

    Read More...
  • Here’s a MySQL tip from the MySQL Performance Blog which deals with possible lock situations while using InnoDB and foreign keys. Today I was working with application which uses Innodb and foreign keys and got into locking problems possibly due to foreign keys, so I did a little investigation on that matter. Peter Zaitsev goes [...]

    Read More...
  • Most of us have had problems with UTF-8 problems in PHP and MySQL. Here’s how to modify your database and table to be UTF-8 compliant. Most of the time we do set the character set to utf8 but forget to set the collation set to utf8. Use the following MySQL statements to convert your database [...]

    Read More...
  • Did you know what the suffix in the MySQL collations are? For example what’s the difference between ascii_bin and ascii_general_ci ? *_bin: represents binary case sensitive collation *_cs: case sensitive collation *_ci: case insensitive collation Read more on this at : MySQL: Case Sensitive MySQL

    Read More...
  • EnterpriseDB

    EnterpriseDB is an open source database system which allows you to port most Oracle applications over to their database server with almost no change to your code. They allow you to use the database free of cost, while providing paid support. So if you’re planning to reduce your TCO costs on your applications look at [...]

    Read More...
  • GROUP_CONCAT(expr) – This function returns a string result with the concatenated non-NULL values from a group. Where it can be useful? For example to get PHP array without looping inside PHP: CREATE TABLE services ( id INT UNSIGNED NOT NULL, client_id INT UNSIGNED NOT NULL, KEY (id)); INSERT INTO services VALUES (1,1),(1,2),(3,5),(3,6),(3,7); SELECT id,client_id FROM [...]

    Read More...
  • An interesting read from Peter Zaitsev about optimizing MySQL queries which use ORDER BY with LIMIT. Suboptimal ORDER BY implementation, especially together with LIMIT is often the cause of MySQL Performance problems. Here is what you need to know about ORDER BY … LIMIT optimization to avoid these problems Read on: MySQL Performance Blog » [...]

    Read More...