Showing entries 31 to 40
« 10 Newer Entries
Displaying posts with tag: query (reset)
Query cache and comments


Ok, as Morgan quickly found out: I'm incredibly stupid. Read his comment and you'll know why. Ok, you'll not know why but you'll know that I am.

Really cool to see Chris taking up blogging as well

He has written nice little example about inserting comments into queries to distinguish the client’s IP when they are funneled through the proxy. Reading the comments about this little trick making the query cache not work, I couldn’t help thinking that those are wrong. I vaguely remembered that in some recent version this shortcoming was fixed, so I decided to run a little test on 5.1.30 to verify:

mysql> select concat(@@version_comment, ' ', @@version); …
[Read more]
MySQL University: Random Query Generator

This Thursday (December 11th), Philip Stoev will talk about the Random Query Generator, a new QA tool that generates pseudo-random queries targeted to exercise a specific part of the server being tested. It then executes those queries to check for crashes or assertions or to compare the results returned from two different servers (two versions, two different storage engines, optimizer flags, etc.). It is also able to execute queries against a replication master, constantly checking that the slave is okay and has not diverged.

Towards the end of the session, Philip will share his desktop and show some live examples. Make sure to adjust your volume in case the MySQL Server will utter agonized sounds.

Note that we'll be using a new session address / Dimdim URL:

[Read more]
MySQL University for up to 100 attendees

Yesterday (December 4th), Sergey Petrunia gave a presentation on what's new in MySQL Optimizer. Unfortunately, the slides didn't show up in the Dimdim presentation area, which also means that the recorded session only has Sergey's voice but not the slides. (I've filed a bug in Dimdim's issue tracker.) However, Sergey kept referring to slide numbers in his talk, so it should be fairly easy (just not as convenient as usual) to follow his recorded presentation.

The slides, together with links to the recording and the chat transcript, can be found on the MySQL University session page.

Next week …

[Read more]
MySQL Enterprise Monitor documentation public now

The MySQL Enterprise Monitor continuously monitors MySQL servers and alerts to potential problems before they impact the system. It helps eliminating security vulnerabilities, improves replication, optimizes performance, and more. Its newest feature, Quan (Query Analyzer), helps identify queries that could be tuned to improve performance. Quan enables database administrators to do the work that would otherwise require hours in just minutes, or even seconds, and it provides ongoing statistical information about the performance of your queries.

MySQL Enterprise Monitor is a commercial offering by Sun Microsystems, and so was the documentation. To help anyone (even if they're not customers) get a better and complete understanding of what exactly MySQL Enterprise Monitor is about and what it can do, we've decided to make its full documentation publicly available. This has been done now, and the docs are part of the MySQL Manual now; see: …

[Read more]
Random selection, with a bias ...

Say you want to randomly select your employee of the month, but not so randomly, better, you'd like to give your best employees a bigger chance to be selected based on their rating.This is just an example, you could be randomly displaying ads from your customers, but giving an higher chance to be displayed to those who are paying more, there can be a million other example, but I hope you got the

MySQL – The GROUP_CONCAT() function

GROUP_CONCAT() function is used to concatenate column values into a single string. It is very useful if you would otherwise perform a lookup of many row and then concatenate them on the client end.

For example if you query:

mysql> SELECT Language FROM CountryLanguage WHERE CountryCode = 'THA';

It outputs:


To concatenate the values into a single string, you query:

mysql> SELECT GROUP_CONCAT(Language) As Languages FROM CountryLanguage WHERE CountryCode = 'THA';

Then the output will be:

Chinese, Khmer, Kuy, Lao …
[Read more]
Has them all

A question that pops up frequently on Devshed forums is "How can I get all products that are available in Red and Green colors?" or "How can I find out which customers bought this book and that CD?", solution is simple and I'll provide an example here, it can be made more complicate at your option, but it all boils down to a where and an having condition.Say we have a table that lists all

Good SQL Querying

By “Good SQL Querying”, I am not referring to “how to make your queries more perfomant.” I am about to go on a mini-rant about how to make readable and self-documenting SQL queries.

One practice that will get me instantly going on a rant is using a comma join. There is NO reason to do the following:

-- uses the sakila sample database
SELECT first_name, last_name, address
FROM customer,address;

What kind of join did the original author intend? A CROSS JOIN? Or did they really want an INNER JOIN and forget the WHERE clause?

The answer: you do not know for sure; you can only guess. Had the query been

SELECT first_name,last_name,address
FROM customer INNER JOIN address;

you would know that the author intended an INNER JOIN; had the query been

SELECT first_name,last_name,address
FROM customer CROSS JOIN address;

you would know that the author intended a CROSS JOIN. I …

[Read more]
Two basic indexing tips ...

Here are two basic tips for proper indexing ...Don't mess with datatypes, too often people refer to an attribute defining it as one datatype in a table and as another in different tables, this actually prevents index usage in joins (forget about FKs for this time ;)) See an example here. You could declare a function based index as a workaround, but why don't we all try to make it right?Put


I've been playing with various GUIs off and on over the last couple of months. I find that I drop to mysql.exe quite often no matter which tool I use. My favorites until recently have been the MySQL GUI Tools and NaviCat.

I was using the Lite edition of Navicat. I actually started using navicat with postgres a few years ago. I like it but the lite version is limited in some annoying ways. It's nice in that it runs (at least the mysql version) in Linux and windows. I don't use a mac so that doesn't really do anything for me.

Of course the MySQL gui tools run just about anywhere.

I just …

[Read more]
Showing entries 31 to 40
« 10 Newer Entries