Showing entries 21496 to 21505 of 44105
« 10 Newer Entries | 10 Older Entries »
Monitoring MySQL SQL statements the way it SHOULD be done!

You may have read a previous post of mine, back in April this year, where I wrote about using the MySQL 5.5 Audit interface to SQL Statement monitoring. There was a bunch of comments and some ideas, but not much happened. Until now that is.

Hereby I release the first version of SQLStats, which is a much enhanced version of what I described in the previous post. This is a MySQL Plugin for MySQL 5.5 that allows you to monitor the most recently executed, and the most frequently executed statements using 2 INFORMATION_SCHEMA tables. The thing is not very complex, to be honest, but it does do the job. So what was the job then? Well, looking at what this plugin does, it goes something like this:

  • Allows you to monitor ALL SQL statements executed by the server.
  • The SQL statements are "normalized", …
[Read more]
Does the insert buffer work?

The insert buffer in InnoDB buffers pending inserts for secondary index pages to avoid blocking on disk reads for those pages during secondary index maintenance. This feature has been renamed the change buffer for InnoDB in MySQL 5.5 as it has been enhanced to support more than inserts.

 

It works for me. But talk is cheap so I will provide a few numbers. You can confirm that it works in theory by running the insert benchmark with change/insert buffering enabled and disabled. Compare the results. I will do this myself today.

 

I can confirm that it works in practice by reviewing the output from SHOW INNODB STATUS. There is a section with a …

[Read more]
MySQL Query Optimization – Tip # 1 – Avoid using wildcard character at the start of a LIKE pattern.

The more I go through others SQL, there are some common mistakes that I see developers making over and over again, so I thought why not start a series of tips that can help developers optimize their queries and avoid common pitfalls. So this post is a part of that series of tips, and this is the first tip "Avoid using a wild card character at the start of a LIKE pattern".

Webinar: Designing MySQL Databases (Italian) - Nov, 25@10am CET

We already have more that 500 registrants for this MySQL web seminar. Join us and the crowd to learn the design dos and don'ts for MySQL. We will show you how to design, forward and reverse engineer databases including discussions on datatypes, indexes, and foreign keys for various application scenarios.

In this technical presentation, we will cover:

  • MySQL design basics
    • Data Modeling Basics
      • Physical and Logical Models
      • "Dos" and "Don'ts"
    • How to design MySQL for your specific application
      • Datatypes
      • Indexes
[Read more]
Moving from MyISAM to Innodb or XtraDB. Basics

I do not know if it is because we're hosting a free webinar on migrating MyISAM to Innodb or some other reason but recently I see a lot of questions about migration from MyISAM to Innodb.

Webinar will cover the process in a lot more details though I would like to go over basics in advance. You can also check my old post on this topic about Moving MyISAM to Innodb as well as searching the blog - We've blogged so much on this topic.

So what are the basics ?

Regression Benchmarks - Make sure to run regression benchmarks in particular in terms of concurrent behavior. You may have hidden …

[Read more]
YPDNGG: You Probably Don’t Need Golden Gate

Before launching into this, I must give due deference to Mogens Nørgaard’s landmark article, You Probably Don’t Need RAC (YPDNR), available here, but originally published Q3 2003 in IOUG Select Journal.  Mogens showed that you can be a friend of Oracle without always agreeing with everything they do.

At Blue Gecko, many of our remote DBA customers have been asking us about Golden Gate.  In July 2009, Oracle bought Golden Gate Software, just one of several companies that have developed log-based replication mechanisms for Oracle and other databases.  This was one of many major acquisitions by Oracle in 2009, including Sun and Relsys. But unlike most of Oracle’s acquisitions, …

[Read more]
Probably the worst way to deal with a stuck query...

is to disable a customer's account for more than 24 hours without any warning whatsoever. This happened to one of my accounts and I'm beyond furious at the database and network administrators of HostGator.com. Seriously, guys, I don't know of a more unprofessional way of dealing with a stuck query.

Converting queries with OR to Union to ulitize indexes

Lets say we have a table storing mail messages and we need to show user’s mailbox: messages sent “from” and “to” the specified user.

Here is our table:

CREATE TABLE `internalmail` (
  `mail_id` int(10) NOT NULL AUTO_INCREMENT,
  `senderaddress_id` int(10) NOT NULL,
  `recipientaddress_id` int(10) NOT NULL,
  `mail_timestamp` timestamp NULL DEFAULT NULL,
... message body, etc ...
  PRIMARY KEY (`mail_id`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1

And our query:

select * from internalmail
 where (senderaddress_id = 247 or recipientaddress_id = 247 or recipientaddress_id = 0) 
and mail_timestamp > '2010-08-01 12:30:47' 
order by mail_timestamp desc 

In this query we show all messages from and to user_id = 247 plus all messages to system user (user_id=0). We need to show only messages for the last 3 months and show the most recent messages first.

To speed up the query we can try creating …

[Read more]
Query caching with MySQL Connector/Python

This blog post shows how to create a cursor class for MySQL Connector/Python which will allow you to cache queries. It will hold the query itself and the result in a global variable.

Note: this is a proof of concept and is only meant as a demonstration on how to extend MySQL Connector/Python.

Why query caching?

You are doing lots of queries that have the same result. It would be expensive to always run the same exact query. MySQL has already a query cache, and there is also memcached. But you like MySQL Connector/Python so much you’d like to do it yourself.

A cursor caching queries and their result

To demonstrate a simple implementation of a query cache, we inherit …

[Read more]
2.0.1 Community Release Available

We are pleased to announce the availability of the 2.0.1 release of Calpont InfiniDB Community.  This is our first maintenance release for 2.0.


This release includes a number of bug fixes that you can see at http://bugs.launchpad.net/infinidb.  You can download the latest InfiniDB binaries, source code, and updated documentation at: http://infinidb.org/downloads.  We welco...

Showing entries 21496 to 21505 of 44105
« 10 Newer Entries | 10 Older Entries »